/* Invoice compatibility bridge. Common shell only; the FV grid, form order,
   pane sizing, mobile tabs and PDF viewer remain governed by original CSS. */
body.portal-invoices{background:#f4f7fb}
body.portal-invoices>.topbar{display:none}
body.portal-invoices #portal-shell{flex:none;position:relative;background:#fff;border-bottom:1px solid #dfe7ef;box-shadow:0 3px 20px #243e5b05;color:#20354e;font:14px "Segoe UI",system-ui,sans-serif;--p-muted:#627487;--p-line:#dfe7ef}
body.portal-invoices #portal-shell .p-top{display:flex;align-items:center;flex-wrap:wrap;min-height:76px;height:auto;padding:15px clamp(16px,2vw,40px);gap:16px;background:#fff;border:0}
body.portal-invoices #portal-shell .p-brand{display:flex;align-items:center;gap:13px;flex:none;padding:0 24px 0 0;border-right:1px solid #dfe7ef}
body.portal-invoices #portal-shell .p-brand strong{display:block;font-size:28px;letter-spacing:-1.2px;color:#0a2547;font-weight:800;line-height:1.15}
body.portal-invoices #portal-shell .p-brand small{display:block;font-size:9px;line-height:1.7;letter-spacing:1.2px;color:#627487;max-width:90px}
body.portal-invoices #portal-shell .p-top>strong{font-size:15px;font-weight:600;color:#627487;flex:1;min-width:0}
body.portal-invoices #portal-shell .p-who{display:flex;align-items:center;gap:13px;padding-left:18px;border-left:1px solid #dfe7ef;flex:none}
body.portal-invoices #portal-shell .p-who strong{display:block;font-size:13px;max-width:210px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.portal-invoices #portal-shell .p-who small{display:block;font-size:11px;color:#627487;margin-top:4px}
body.portal-invoices #portal-shell button{font:600 12px "Segoe UI",system-ui,sans-serif;min-height:34px;min-width:0;padding:8px 12px;border-radius:8px;border:1px solid #e5ebf2;color:#345b7e;background:#f8fafc;cursor:pointer;transition:background .15s}
body.portal-invoices #portal-shell button:hover:not(:disabled){background:#edf3fa;border-color:#cbddef}
body.portal-invoices #portal-shell button:focus-visible{outline:3px solid #82afe7;outline-offset:2px}
body.portal-invoices #portal-shell .p-avatar{display:grid;place-items:center;flex:none;width:38px;height:38px;border-radius:50%;background:#edf4fc;color:#326db7;border:1px solid #d8e6f7;text-transform:uppercase;padding:0}
body.portal-invoices #portal-shell .p-nav-horizontal{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;padding:0 clamp(16px,2vw,40px) 16px}
body.portal-invoices #portal-shell .p-nav-horizontal>button{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-width:0;min-height:46px;padding:11px 18px;font-size:13px;font-weight:650;white-space:normal;border-radius:11px;background:#f5f8fc;border-color:#e6edf5;color:#476078;line-height:1.4}
body.portal-invoices #portal-shell .p-nav-horizontal svg{width:18px;height:18px;flex:none}
body.portal-invoices #portal-shell .p-nav-horizontal>button[aria-current=page]{background:#eaf2fd;color:#225ea9;border-color:#c8daf4;box-shadow:inset 0 -2px #3578cd}
body.portal-invoices #portal-shell .p-subnav{display:flex;flex-wrap:wrap;gap:7px;padding:12px clamp(16px,2vw,40px) 16px;min-height:87px;box-sizing:border-box;border-top:1px solid #edf1f6;background:#fbfcfe;align-items:stretch}
body.portal-invoices #portal-shell .p-subnav>button{display:flex;flex-direction:column;text-align:left;align-items:stretch;justify-content:center;gap:4px;min-width:145px;flex:0 1 auto;min-height:58px;padding:9px 14px;border:1px solid transparent;border-radius:9px;background:transparent}
body.portal-invoices #portal-shell .p-subnav strong{font-size:12px;font-weight:650}
body.portal-invoices #portal-shell .p-subnav small{font-size:10px;font-weight:400;color:#627487;line-height:1.4}
body.portal-invoices #portal-shell .p-subnav>button[aria-current=page]{background:#fff;border-color:#d9e5f3;box-shadow:0 2px 8px #234c7610;color:#275f9f}
body.portal-invoices .module-nav{display:none}
body.portal-invoices .workspace-toolbar{justify-content:flex-end}
body.portal-invoices .workspace-toolbar:has(#fv-actions[hidden]){display:none}
/* Palette only for System FV: no grid, dimensions, field or order overrides. */
body.portal-invoices #module-fv .workspace-grid{border-color:#dce6f1;box-shadow:0 3px 14px #29496e08}
body.portal-invoices #module-fv .section-heading{background:#f6f9fd;color:#2b4f72;border-color:#dce6f1}
body.portal-invoices #module-fv .document.selected{background:#eaf2fd;border-color:#8db6e8;box-shadow:inset 3px 0 #3578cd}
body.portal-invoices #module-fv .details-actions .primary{background:#2b68ba;border-color:#2b68ba}
body.portal-invoices #module-reports{border-color:#dce6f1;border-radius:12px;color:#294966}
body.portal-invoices #module-reports .register-views>button{border-radius:9px;background:#f5f8fc;border-color:#dfe8f2;color:#496981}
body.portal-invoices #module-reports .register-views>button[aria-selected=true]{background:#eaf2fd;color:#225ea9;border-color:#c8daf4;box-shadow:inset 0 -2px #3578cd}
body.portal-invoices #module-reports #register-export{background:#2b68ba;border-color:#2b68ba;color:#fff}
body.portal-invoices #module-reports .register-content{min-width:0}
/* The register can grow naturally under the common header. Fixed three-pane
   desktop scrolling remains exclusive to System FV. */
body.portal-invoices:has(#module-reports:not([hidden])){height:auto;min-height:100dvh;overflow:auto;display:block}
body.portal-invoices:has(#module-reports:not([hidden])) main{height:auto;display:block}
body.portal-invoices:has(#module-reports:not([hidden])) #workspace{height:auto;display:block}
body.portal-invoices #module-reports .register-content{flex:none;max-height:65vh;overflow:auto}
body.portal-invoices #module-reports .register-overview{margin:4px 0 16px;padding:18px 20px;border:1px solid #dce6f1;border-radius:12px;background:#f9fbfe}
body.portal-invoices #module-reports .register-overview-heading{display:flex;flex-wrap:wrap;align-items:baseline;gap:10px;margin-bottom:8px}
body.portal-invoices #module-reports .register-overview-heading strong{font-size:15px;color:#294966}
body.portal-invoices #module-reports .register-overview-heading span{font-size:12px;color:#637990}
body.portal-invoices #module-reports .register-applied-scope,body.portal-invoices #module-reports .register-scope-rule,body.portal-invoices #module-reports .register-visible-count{font-size:12px;line-height:1.6;color:#64798d;margin:8px 0;overflow-wrap:anywhere}
body.portal-invoices #module-reports .register-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(190px,100%),1fr));gap:10px;margin-top:14px}
body.portal-invoices #module-reports .register-metric{padding:12px 16px;background:#fff;border:1px solid #dce7f2;border-top:3px solid #3a7ac1;border-radius:9px;display:flex;flex-direction:column;gap:5px;min-width:0}
body.portal-invoices #module-reports .register-metric:nth-child(2){border-top-color:#7065ae}
body.portal-invoices #module-reports .register-metric:nth-child(n+3){border-top-color:#289780}
body.portal-invoices #module-reports .register-metric.register-metric-incomplete{border-top-color:#bf8127;background:#fffcf5}
body.portal-invoices #module-reports .register-metric>span{font-size:12px;color:#5b7188}
body.portal-invoices #module-reports .register-metric>strong{font-size:25px;line-height:1.35;color:#264b6e;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
body.portal-invoices #module-reports .register-metric>small{font-size:11px;line-height:1.5;color:#61778d}
body.portal-invoices #module-reports .register-metric-incomplete>small{color:#966019}
body.portal-invoices #module-reports .register-scope-notice{padding:10px 12px;margin:10px 0;border:1px solid #ebd6ab;border-radius:7px;background:#fff6df;color:#785414;font-size:12px;line-height:1.6;overflow-wrap:anywhere}
body.portal-invoices #module-reports .register-overview[data-pending=true] .register-metrics{opacity:.7}
body.portal-invoices #module-reports .register-overview[hidden],body.portal-invoices #module-reports .register-scope-notice[hidden]{display:none}
body.portal-invoices #module-reports .www-table-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:10px;padding:12px 16px;margin:14px 0 0;background:#fff;border:1px solid #dce6f1;border-bottom:0;border-radius:12px 12px 0 0;color:#60778e;font-size:12px}
body.portal-invoices #module-reports .www-table-summary{margin-right:auto;font-variant-numeric:tabular-nums}
body.portal-invoices #module-reports .www-table-toolbar button,body.portal-invoices #module-reports .www-table-columns>summary{min-height:34px;padding:7px 12px;border:1px solid #d7e3f1;border-radius:7px;color:#345d85;background:#f8faff;font-size:12px;cursor:pointer}
body.portal-invoices #module-reports .www-table-columns{position:relative}
body.portal-invoices #module-reports .www-table-columns>summary{list-style:none}
body.portal-invoices #module-reports .www-table-columns>summary::-webkit-details-marker{display:none}
body.portal-invoices #module-reports .www-table-column-panel{position:absolute;right:0;top:calc(100% + 8px);width:min(370px,80vw);max-height:45vh;overflow:auto;z-index:15;padding:18px;background:#fff;border:1px solid #cfdfef;border-radius:10px;box-shadow:0 12px 35px #173e6426;display:flex;gap:10px;flex-wrap:wrap}
body.portal-invoices #module-reports .www-table-column-panel>strong,body.portal-invoices #module-reports .www-table-column-panel>small{flex-basis:100%;line-height:1.6}
body.portal-invoices #module-reports .www-table-column-list{width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
body.portal-invoices #module-reports .www-table-column-list>label{display:flex;align-items:center;gap:7px;padding:7px 3px;font-size:12px;line-height:1.45;cursor:pointer;min-width:0}
body.portal-invoices #module-reports .www-table-column-list input{width:15px;height:15px;min-height:0;flex:none;accent-color:#347abd;margin:0}
body.portal-invoices #module-reports .www-table-frame{overflow:auto;max-width:100%;border:1px solid #dce6f1;border-radius:0 0 12px 12px;background:#fff}
body.portal-invoices #module-reports table[data-www-table]{border-collapse:separate;border-spacing:0;font-size:13px;line-height:1.5;min-width:780px;width:100%;background:#fff}
body.portal-invoices #module-reports table[data-www-table] tr>[hidden]{display:none!important}
body.portal-invoices #module-reports table[data-www-table] th{background:#eef4fb;color:#315471;font-weight:650;font-size:12px;padding:13px 16px;border:0;border-bottom:1px solid #d5e2ef;vertical-align:middle;white-space:nowrap}
body.portal-invoices #module-reports table[data-www-table] tbody td{padding:12px 16px;border:0;border-bottom:1px solid #edf1f6;vertical-align:middle;background:#fff;color:#36526c}
body.portal-invoices #module-reports table[data-www-table] tbody tr:nth-child(even)>td{background:#f8fafd}
body.portal-invoices #module-reports table[data-www-table] tbody tr:hover>td{background:#edf5ff}
body.portal-invoices #module-reports table[data-www-table] .www-table-number{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;color:#284866}
body.portal-invoices #module-reports .register-documents-table td:is([data-label="Data FV"],[data-label="Numer"],[data-label="Waluta"],[data-label="Status"]){white-space:nowrap}
body.portal-invoices #module-reports .www-table-frame[data-density=compact] table[data-www-table] tbody td{padding:7px 12px}
body.portal-invoices #module-reports .www-table-frame[data-density=compact] table[data-www-table] th{padding:9px 12px}
@media(max-width:1150px){body.portal-invoices #portal-shell .p-brand small{display:none}body.portal-invoices #portal-shell .p-top{gap:8px}body.portal-invoices #portal-shell .p-who>div{max-width:130px}body.portal-invoices #portal-shell .p-who strong{max-width:130px}body.portal-invoices #portal-shell .p-who small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}}
@media(max-width:750px){body.portal-invoices #portal-shell .p-top{padding:12px 16px;gap:10px}body.portal-invoices #portal-shell .p-brand{flex:1;border:0;padding:0}body.portal-invoices #portal-shell .p-who{border:0;padding:0;gap:7px}body.portal-invoices #portal-shell .p-top>strong,body.portal-invoices #portal-shell .p-who>div{display:none}body.portal-invoices #portal-shell .p-nav-horizontal{grid-template-columns:repeat(3,minmax(0,1fr))}body.portal-invoices #portal-shell .p-nav-horizontal>button{font-size:12px;padding:9px 8px}body.portal-invoices #portal-shell .p-subnav>button{flex:0 1 160px;min-width:0}body.portal-invoices #module-reports .www-table-summary{flex-basis:100%}body.portal-invoices #module-reports .www-table-column-panel{left:0;right:auto;width:min(320px,calc(100vw - 65px))}}
@media(max-width:600px){body.portal-invoices #module-reports .register-documents-table[data-www-table]{min-width:0;width:100%}body.portal-invoices #module-reports .register-documents-table[data-www-table] tbody td{padding:6px;border:0}body.portal-invoices #module-reports .register-documents-table[data-www-table] tbody tr:nth-child(even)>td{background:transparent}body.portal-invoices #module-reports .register-documents-table[data-www-table] .www-table-number{text-align:left}}
@media(max-width:450px){body.portal-invoices #portal-shell .p-nav-horizontal{grid-template-columns:repeat(2,minmax(0,1fr))}body.portal-invoices #portal-shell .p-nav-horizontal>button{font-size:11px}body.portal-invoices #portal-shell .p-back{display:none}body.portal-invoices #portal-shell .p-brand strong{font-size:24px}body.portal-invoices #portal-shell .p-brand small{font-size:8px;letter-spacing:.6px}body.portal-invoices #portal-shell .p-top .p-brand small{display:none}body.portal-invoices #portal-shell .p-top button{padding:7px 6px}body.portal-invoices #portal-shell .p-top .p-bell,body.portal-invoices #portal-shell .p-top .p-logout{font-size:11px}body.portal-invoices #portal-shell .p-top .p-avatar{padding:0}body.portal-invoices #portal-shell .p-top .p-brand{flex:1 1 60px;min-width:60px}}
