/* Companion rules for the standalone PHP version.  Base design is styles.css. */
.scope-switcher a{border:0;background:transparent;border-radius:7px;padding:9px 14px;color:var(--muted);font-size:12px;font-weight:700;text-decoration:none;white-space:nowrap}.scope-switcher a.active{background:var(--green-soft);color:var(--green-deep)}
.page-subtitle{margin-top:5px;color:var(--muted)}
.category-filter input{width:150px;border:1px solid #d9deda;border-radius:7px;padding:7px 9px;color:var(--ink);background:#fff;font:14px inherit}.category-filter .secondary-button{padding:8px 10px;white-space:nowrap}
.inventory-section tr.stock-critical td:nth-child(3)::after{content:" · warto zamówić";font-size:11px;font-weight:700;color:#9c392e}.inventory-section tr.stock-warning td:nth-child(3)::after{content:" · obserwuj stan";font-size:11px;font-weight:700;color:#8a620f}
.sidebar-note a{color:#bfc6d3;text-decoration:none}.sidebar-note a:hover{color:#fff}
.nav-item{text-decoration:none}
.row-actions{display:flex;justify-content:flex-end;align-items:center;gap:10px;white-space:nowrap}.row-actions form{margin:0}.danger-button{color:#a34938}.source-lock{color:var(--muted);font-size:12px}
.inventory-compact{min-width:0!important}.inventory-compact th:last-child,.inventory-compact td:last-child{width:100px}.inventory-product{display:flex;align-items:center;gap:12px;border:0;background:transparent;padding:0;color:var(--ink);font:600 14px/1.35 inherit;text-align:left;cursor:pointer}.inventory-product img,.product-detail-head img{width:42px;height:42px;object-fit:cover;border-radius:9px;border:1px solid var(--line);background:#fff}.product-placeholder{display:grid;place-items:center;width:42px;height:42px;border-radius:9px;background:var(--green-soft);color:var(--green-deep);font-size:11px;font-weight:800}.product-detail-head{display:flex;gap:14px;align-items:center;margin:16px 0 6px}.product-detail-head p{margin:2px 0;color:var(--muted)}
.unit-margin{display:grid;grid-template-columns:1fr auto;gap:3px 15px;margin:18px 0;padding:14px 16px;border-left:3px solid var(--green);border-radius:0 9px 9px 0;background:var(--green-soft)}.unit-margin span{font-size:12px;color:#476256}.unit-margin strong{text-align:right;font-size:16px}.unit-margin small{grid-column:1/-1;color:#607067;font-size:11px;margin-bottom:7px}.unit-margin small:last-child{margin-bottom:0}
.product-profit-layout{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;margin:22px 0 16px}.price-card{min-width:0;border:1px solid var(--line);border-radius:12px;padding:15px;background:#f8faf9}.price-card>span{display:block;color:var(--muted);font-size:11px;font-weight:800;letter-spacing:.06em;text-transform:uppercase}.price-card>strong{display:block;margin:5px 0 12px;font-size:13px}.price-card b{display:block;font-size:22px;letter-spacing:-.5px}.price-card p,.price-card em{display:block;margin:7px 0 0;color:var(--muted);font-size:11px;font-style:normal;line-height:1.45}.purchase-card{background:#fff}.purchase-card label{display:flex;align-items:center;border:1px solid #cfd7d2;border-radius:8px;background:#fff;overflow:hidden}.purchase-card input{min-width:0;width:100%;border:0!important;padding:10px!important;font:700 18px inherit!important;outline:0}.purchase-card label small{padding:0 10px 0 0;color:var(--muted);white-space:nowrap}.woo-card{background:#f3f7f5}.margin-card{background:var(--green-deep);border-color:var(--green-deep)}.margin-card>span,.margin-card>strong,.margin-card p{color:#c6d7d0}.margin-card b{color:#fff}.margin-card b.expense{color:#ffbeb5}.product-note{margin:0!important;padding:12px 14px;border-radius:8px;background:#f1f4f2;font-size:12px!important;color:#59645e!important}
.margin-cell{font-size:14px;white-space:nowrap}.margin-empty{color:var(--muted);font-size:12px}
.ksef-progress{display:flex;align-items:flex-start;gap:14px;margin:16px 0;padding:16px;border-radius:10px;background:#eef5f1;border-left:3px solid var(--green)}.ksef-progress-icon{display:grid;place-items:center;flex:0 0 34px;height:34px;border-radius:9px;background:var(--green-deep);color:#fff;font-weight:800}.ksef-progress strong{display:block;margin:1px 0 4px}.ksef-progress p{margin:0;color:#52665c;font-size:13px;line-height:1.45}.credentials-edit{margin-top:16px;border-top:1px solid var(--line);padding-top:14px}.credentials-edit summary{cursor:pointer;color:var(--green-deep);font-size:13px;font-weight:700}.credentials-edit>p{color:var(--muted);font-size:12px}
.comparison-grid{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:16px;margin:18px 0}.comparison-intro{background:#f4f8f6}.comparison-intro h3{margin:3px 0 7px}.comparison-intro p:not(.eyebrow){margin:0;color:var(--muted);font-size:13px}.comparison-card{display:grid;gap:5px}.comparison-card p{margin:0;color:var(--muted);font-size:13px}.comparison-card strong{font-size:25px;letter-spacing:-.6px}.comparison-card span{font-size:13px;font-weight:800}.comparison-card small{color:var(--muted);font-size:12px}.trend-panel{margin:18px 0}.trend-filter label{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px;font-weight:700}.trend-filter select{border:1px solid var(--line);border-radius:8px;background:#fff;padding:8px;font:600 12px inherit;color:var(--ink)}.trend-chart{height:220px;display:flex;align-items:flex-end;gap:16px;padding:18px 8px 0;border-bottom:1px solid var(--line)}.trend-column{height:100%;min-width:58px;flex:1;display:grid;grid-template-rows:28px 1fr 24px;gap:7px;text-align:center}.trend-value{font-size:11px;font-weight:800;white-space:nowrap}.trend-track{height:100%;display:flex;align-items:flex-end;justify-content:center;border-radius:7px 7px 0 0;background:#f0f3f1;overflow:hidden}.trend-track i{display:block;width:min(52px,72%);border-radius:7px 7px 0 0}.trend-track i.positive{background:linear-gradient(#5c9c81,#14533e)}.trend-track i.negative{background:linear-gradient(#e29989,#aa4939)}.trend-column small{color:var(--muted);font-size:11px;font-weight:700}.trend-note{margin:14px 0 0;color:var(--muted);font-size:12px}
.login-card{max-width:420px;margin:12vh auto;padding:30px;background:#fff;border:1px solid var(--line);border-radius:14px}.login-card h1{margin:4px 0 8px}.login-card>p:not(.eyebrow){color:var(--muted)}.login-form{display:grid;gap:13px;margin-top:24px}.login-form label{display:grid;gap:6px;font-size:12px;font-weight:700}.login-form input{border:1px solid #d9deda;border-radius:7px;padding:11px;font:14px inherit}.login-form button{justify-self:start}.error{background:#fbeceb!important;color:#9c392e!important;border-radius:7px;padding:9px;margin-top:15px}
@media(max-width:800px){.scope-switcher a{flex:1;text-align:center;padding:9px 10px}.login-card{margin:8vh 18px}.login-card h1{font-size:26px}}
@media(max-width:800px){.row-actions{gap:8px}.inventory-compact{min-width:0!important}.inventory-product span:last-child{max-width:175px}.inventory-section tr.stock-critical td:nth-child(2)::after,.inventory-section tr.stock-warning td:nth-child(2)::after{display:block;margin-top:4px}.product-detail-head img{width:54px;height:54px}}
@media(max-width:650px){.product-profit-layout{grid-template-columns:1fr;gap:8px}.price-card{padding:14px}.price-card b{font-size:21px}}
@media(max-width:800px){.comparison-grid{grid-template-columns:1fr}.trend-chart{height:190px;gap:7px}.trend-column{min-width:34px}.trend-value{font-size:9px}.trend-filter{width:100%;margin-top:10px}.trend-filter label{justify-content:space-between}.trend-filter select{max-width:160px}}
dialog.invoice-details-dialog{width:min(1060px,calc(100vw - 32px));max-width:1060px;padding:34px 38px;border:0;border-radius:24px;box-shadow:0 24px 80px rgba(0,0,0,.28)}
.invoice-details-dialog::backdrop{background:rgba(15,20,18,.55)}
.invoice-details-dialog .dialog-header{align-items:flex-start;margin-bottom:24px}.invoice-details-dialog .dialog-header h2{max-width:800px;margin:6px 0 4px}.invoice-details-dialog .dialog-note{margin:0}
.invoice-facts{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:0 0 28px}.invoice-facts>div{padding:16px;border:1px solid #e3e9e5;border-radius:12px;background:#f7faf8}.invoice-facts small{display:block;color:#728078;font-weight:700;margin-bottom:7px}.invoice-facts strong{display:block;font-size:16px;color:#183d30}.invoice-lines{border:1px solid #e3e9e5;border-radius:14px;padding:20px 22px;margin-bottom:26px}.invoice-lines .panel-header{margin-bottom:12px}.invoice-lines .panel-header h3{margin:0}.invoice-lines .panel-header p{margin:4px 0 0}.invoice-lines table{min-width:0}.invoice-lines th,.invoice-lines td{padding:14px 12px}.ksef-planned-panel{margin-top:18px}
.invoice-assignment{display:flex;align-items:end;gap:14px;padding:16px 18px;margin:0 0 20px;border-radius:12px;background:#f2f7f4}.invoice-assignment label{display:grid;gap:7px;flex:1;font-weight:700}.invoice-assignment select{max-width:280px}.invoice-assignment input[type="date"]{max-width:260px}.invoice-assignment .button{white-space:nowrap}.payment-status{font-weight:700;border:0;border-radius:8px;padding:7px 10px}.payment-status.unpaid{background:#eef1f4;color:#66717a}.payment-status.planned{background:#fff1ca;color:#895d00}.payment-status.paid{background:#dcefe5;color:#17563e}.status-form{display:grid;gap:5px;min-width:250px}.status-note{font-size:12px;color:#8a6515;font-weight:700;white-space:nowrap}.due-amount{font-weight:800;color:#b45643;white-space:nowrap}.warning-pill{background:#fff5df;color:#8a6515}.positive-pill{background:#e6f3ed;color:#125a42}.ksef-planned-panel{border-color:#ead7a0}.ksef-paid-panel{border-color:#bfe0cc}.planned-metric{background:#fff8e8!important}
@media(max-width:760px){dialog.invoice-details-dialog{padding:24px 18px}.invoice-facts{grid-template-columns:1fr 1fr}.invoice-lines{padding:16px}.invoice-lines .inventory-table-wrap{overflow:auto}.invoice-assignment{display:grid;align-items:stretch}}
.calendar-connect-card{display:flex;gap:22px;align-items:flex-start;margin:0;background:#fff}.calendar-connect-icon{flex:0 0 54px;height:54px;border-radius:14px;background:#14533e;color:#fff;display:grid;place-items:center;font-size:24px;font-weight:900}.calendar-connect-copy{min-width:0;flex:1}.calendar-connect-copy h3{margin:3px 0 7px;font-size:23px}.calendar-connect-copy>p:not(.eyebrow){color:#66736d;max-width:780px;margin:0 0 18px}.calendar-url{display:flex;gap:10px;align-items:end;margin-top:18px}.calendar-url label{flex:1;font-weight:800;color:#45534d}.calendar-url input{display:block;width:100%;margin-top:7px;padding:12px;border:1px solid #d7dfda;border-radius:9px;background:#f7faf8;font-size:13px}.calendar-steps{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:16px;color:#52615a;font-size:13px}.calendar-steps span{padding:11px 12px;background:#eef5f1;border-radius:9px}.calendar-steps b{display:inline-grid;place-items:center;width:20px;height:20px;margin-right:6px;background:#14533e;color:#fff;border-radius:50%}@media(max-width:700px){.calendar-connect-card{padding:20px;gap:14px}.calendar-connect-icon{flex-basis:42px;height:42px;font-size:19px}.calendar-url{align-items:stretch;flex-direction:column}.calendar-steps{grid-template-columns:1fr}}
th[title="Sortuj"]::after{content:'↕';display:inline-block;margin-left:7px;color:#789086;font-size:12px;font-weight:900}th[title="Sortuj"]:hover::after,th[title="Sortuj"]:focus::after{color:#14533e}.margin-card b.income{color:#fff!important}
.ksef-unpaid-panel,.ksef-planned-panel,.ksef-paid-panel{margin-top:18px}.ksef-unpaid-panel table,.ksef-planned-panel table,.ksef-paid-panel table{min-width:1220px}.ksef-unpaid-panel th,.ksef-planned-panel th,.ksef-paid-panel th{padding-top:17px;padding-bottom:14px}.ksef-unpaid-panel td,.ksef-planned-panel td,.ksef-paid-panel td{padding-top:16px;padding-bottom:16px}.invoice-gross{color:#af5443;font-weight:900;white-space:nowrap;letter-spacing:.01em;padding-left:24px!important}.invoice-date,.invoice-due{white-space:nowrap;color:#4d5a54}.invoice-date{min-width:118px;padding-right:24px!important}.invoice-due{min-width:132px;padding-right:22px!important}.invoice-due.missing{color:#a87926;font-weight:800;font-size:12px}.ksef-unpaid-panel th:nth-child(3),.ksef-planned-panel th:nth-child(3),.ksef-paid-panel th:nth-child(3){padding-right:24px}.ksef-unpaid-panel th:nth-child(4),.ksef-planned-panel th:nth-child(4),.ksef-paid-panel th:nth-child(4){padding-left:18px;padding-right:22px}.ksef-unpaid-panel th:nth-child(5),.ksef-planned-panel th:nth-child(5),.ksef-paid-panel th:nth-child(5){padding-left:24px;min-width:160px}
.period-control label{display:grid;gap:4px;color:#718078;font-size:11px;font-weight:800;letter-spacing:.04em;text-transform:uppercase}.period-control .period{min-width:145px;font:600 14px inherit;letter-spacing:0;text-transform:none}.google-credentials-form{display:grid;grid-template-columns:1fr 1fr auto;gap:12px;align-items:end;margin-top:18px}.google-credentials-form label{display:grid;gap:7px;color:#45534d;font-size:12px;font-weight:800}.google-credentials-form input{min-width:0;padding:12px;border:1px solid #d7dfda;border-radius:9px;background:#fff;font:14px inherit}.google-credentials-form button{min-height:43px}.calendar-connect-card .integration-note{margin:18px 0 0}@media(max-width:800px){.google-credentials-form{grid-template-columns:1fr}.period-control{width:100%}.period-control label{max-width:180px;margin-left:auto}}
.period-control select.period{appearance:auto;cursor:pointer;background:#fff;border:1px solid #d7dfda;border-radius:9px;padding:10px 12px}.comparison-mode{margin-top:15px}.comparison-mode label{display:grid;gap:5px;color:#53645b;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em}.comparison-mode select{border:1px solid #d7dfda;border-radius:8px;background:#fff;padding:9px 10px;color:var(--ink);font:600 13px inherit;text-transform:none;letter-spacing:0}.finance-gross{white-space:nowrap;font-weight:800}
.sortable-heading{user-select:none}.sort-hint{color:#4d8a72;font-size:.85em;margin-left:3px}
.ksef-table-panel{overflow:hidden}.ksef-table-panel .table-wrap{overflow-x:auto}.ksef-table-panel table{min-width:1060px!important;table-layout:fixed}.ksef-table-panel th,.ksef-table-panel td{padding:12px 8px!important;vertical-align:middle}.ksef-table-panel th{font-size:11px;letter-spacing:.055em}.ksef-table-panel th:nth-child(1){width:20%}.ksef-table-panel th:nth-child(2){width:16%}.ksef-table-panel th:nth-child(3){width:10%}.ksef-table-panel th:nth-child(4){width:12%}.ksef-table-panel th:nth-child(5){width:12%}.ksef-table-panel th:nth-child(6){width:9%}.ksef-table-panel th:nth-child(7){width:15%}.ksef-table-panel th:last-child{width:72px}.ksef-supplier,.ksef-number{overflow-wrap:anywhere}.ksef-date,.ksef-due,.due-amount,.ksef-details{white-space:nowrap}.ksef-due{color:#4d5a54}.ksef-due.missing{color:#a87926;font-weight:800;font-size:12px}.ksef-unit .pill{font-size:12px;padding:6px 8px}.ksef-table-panel .status-form{min-width:0;width:100%;gap:3px}.ksef-table-panel .payment-status{width:100%;min-width:0;padding:6px 7px;font-size:12px}.ksef-table-panel .status-note{font-size:10px;letter-spacing:0;white-space:normal;line-height:1.3}.ksef-details{padding-left:2px!important;padding-right:4px!important}.ksef-details .link-button{font-size:12px;white-space:nowrap}.finance-gross{padding-left:8px!important;padding-right:8px!important}.table-panel .source-lock{display:none}.table-panel .row-actions:has(.source-lock){width:1px;padding-left:0!important;padding-right:0!important}.table-panel .inventory-table-wrap table{table-layout:fixed}.table-panel .inventory-table-wrap th,.table-panel .inventory-table-wrap td{padding-left:10px;padding-right:10px}.table-panel .inventory-table-wrap th:nth-child(1){width:105px}.table-panel .inventory-table-wrap th:nth-child(3){width:170px}.table-panel .inventory-table-wrap th:nth-child(4){width:125px}.table-panel .inventory-table-wrap th:nth-child(5){width:135px}.table-panel .inventory-table-wrap th:nth-child(6){width:90px}.table-panel .inventory-table-wrap td:nth-child(2){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.table-panel .inventory-table-wrap .tag{white-space:nowrap}.table-panel .inventory-table-wrap .row-actions{white-space:nowrap}.table-panel .inventory-table-wrap .row-actions .link-button{font-size:12px}

/* v46: KSeF cards, fixed navigation and a readable inventory product column. */
@media (min-width:801px){.app-shell{align-items:start}.sidebar{position:sticky;top:0;align-self:start;height:100vh;overflow-y:auto}}
.metric-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:18px 0}.metric-card{display:flex;flex-direction:column;min-height:144px;padding:22px;background:#fff;border:1px solid var(--line);border-radius:14px}.metric-card>span{color:var(--muted);font-weight:600}.metric-card strong{display:block;margin:10px 0 5px;font-size:31px;letter-spacing:-1px}.metric-card small{margin-top:auto;color:var(--muted)}.metric-card.warning{background:#fff8e8;border-color:#f0ddb0;color:#8a6515}.metric-card.warning>span,.metric-card.warning small{color:#8a6515}.metric-card.positive{background:var(--green-deep);border-color:var(--green-deep);color:#fff}.metric-card.positive>span,.metric-card.positive small{color:#c6d7d0}
.inventory-section .inventory-table-wrap .inventory-compact{width:100%;min-width:760px!important;table-layout:fixed}.inventory-section .inventory-table-wrap .inventory-compact th:nth-child(1){width:auto}.inventory-section .inventory-table-wrap .inventory-compact th:nth-child(2){width:180px}.inventory-section .inventory-table-wrap .inventory-compact th:nth-child(3){width:190px}.inventory-section .inventory-table-wrap .inventory-compact th:nth-child(4){width:105px}.inventory-section .inventory-compact td:first-child{min-width:0}.inventory-section .inventory-compact .inventory-product{width:100%;min-width:0}.inventory-section .inventory-compact .inventory-product span:last-child{min-width:0;flex:1;word-break:normal;overflow-wrap:normal}
@media(max-width:800px){.metric-grid{grid-template-columns:1fr}.inventory-section .inventory-table-wrap .inventory-compact{min-width:720px!important}}

/* v47: KSeF — stabilna tabela i czytelne szczegóły faktury. */
.ksef-table-panel .table-wrap{overflow-x:auto;padding-bottom:2px}
.ksef-table-panel table{min-width:1140px!important}
.ksef-table-panel th:nth-child(1){width:19%}
.ksef-table-panel th:nth-child(2){width:16%}
.ksef-table-panel th:nth-child(3){width:10%}
.ksef-table-panel th:nth-child(4){width:11%}
.ksef-table-panel th:nth-child(5){width:13%}
.ksef-table-panel th:nth-child(6){width:10%}
.ksef-table-panel th:nth-child(7){width:15%}
.ksef-table-panel th:last-child{width:106px}
.ksef-table-panel td.ksef-details{padding:10px 14px 10px 10px!important;text-align:right;white-space:nowrap}
.ksef-details .link-button{display:inline-flex;align-items:center;justify-content:center;min-width:84px;min-height:34px;padding:8px 10px;border:1px solid #bbd8cc;border-radius:9px;background:#edf6f1;color:#145a43;font-size:12px;font-weight:800;line-height:1;text-decoration:none;cursor:pointer}
.ksef-details .link-button:hover,.ksef-details .link-button:focus{background:#dceee5;color:#0f4936;border-color:#82b8a0;outline:none}
dialog.invoice-dialog{width:min(1100px,calc(100vw - 32px));max-width:1100px;max-height:calc(100vh - 42px);overflow:auto;padding:34px 38px;border:0;border-radius:24px;box-shadow:0 24px 80px rgba(0,0,0,.28);background:#fff;color:#1c2822}
dialog.invoice-dialog::backdrop{background:rgba(15,20,18,.58)}
.invoice-dialog>.dialog-close{position:absolute;top:22px;right:24px;display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:12px;background:#eef2ef;color:#26332d;font-size:31px;line-height:1;cursor:pointer}
.invoice-dialog>.dialog-close:hover,.invoice-dialog>.dialog-close:focus{background:#dceee5;color:#0f4936;outline:2px solid #9bc8b4;outline-offset:2px}
.invoice-dialog>.eyebrow{margin-right:60px}
.invoice-dialog>h2{max-width:860px;margin:8px 60px 4px 0;font-size:clamp(28px,3.2vw,42px);line-height:1.08;letter-spacing:-.035em}
.invoice-dialog>.invoice-number{margin:0 0 25px;color:#67766e;font-size:17px;font-weight:700}
.invoice-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:0 0 22px}
.invoice-summary-grid article{min-width:0;padding:18px;border:1px solid #dfe8e3;border-radius:14px;background:#f7faf8}
.invoice-summary-grid article:first-child{background:#edf6f1;border-color:#c5dfd1}
.invoice-summary-grid span{display:block;margin-bottom:8px;color:#6d7c74;font-size:12px;font-weight:800;letter-spacing:.03em;text-transform:uppercase}
.invoice-summary-grid strong{display:block;overflow-wrap:anywhere;color:#174b39;font-size:21px;line-height:1.2}
.invoice-dialog .invoice-assignment{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;align-items:end;gap:14px;margin:0 0 22px;padding:18px;border:1px solid #dbe8e1;border-radius:14px;background:#f0f6f3}
.invoice-dialog .invoice-assignment label{display:grid;gap:7px;min-width:0;color:#43564d;font-size:13px;font-weight:800}
.invoice-dialog .invoice-assignment input,.invoice-dialog .invoice-assignment select{width:100%;min-width:0}
.invoice-dialog .invoice-assignment .button{min-height:42px;white-space:nowrap}
.invoice-dialog .invoice-positions{margin:0;padding:22px 24px;border:1px solid #dce7e1;border-radius:16px;background:#fff}
.invoice-dialog .invoice-positions h3{margin:0 0 5px;font-size:20px}
.invoice-dialog .invoice-positions p{margin:0 0 17px;color:#68766f;font-size:13px}
.invoice-dialog .invoice-positions .table-wrap{overflow-x:auto;border-top:1px solid #e3eae6}
.invoice-dialog .invoice-positions table{width:100%;min-width:640px!important;table-layout:auto!important}
.invoice-dialog .invoice-positions th,.invoice-dialog .invoice-positions td{padding:14px 16px!important;vertical-align:middle}
.invoice-dialog .invoice-positions th{font-size:11px;letter-spacing:.06em}
.invoice-dialog .invoice-positions th:nth-child(1){width:auto}
.invoice-dialog .invoice-positions th:nth-child(2){width:105px}
.invoice-dialog .invoice-positions th:nth-child(3){width:135px}
.invoice-dialog .invoice-positions th:nth-child(4){width:90px}
.invoice-dialog .invoice-positions td:first-child{font-weight:650;overflow-wrap:anywhere}
@media(max-width:760px){dialog.invoice-dialog{width:calc(100vw - 20px);max-height:calc(100vh - 20px);padding:25px 18px;border-radius:18px}.invoice-dialog>.dialog-close{top:14px;right:14px;width:40px;height:40px;font-size:28px}.invoice-dialog>h2{margin-right:48px;font-size:28px}.invoice-summary-grid{grid-template-columns:1fr 1fr;gap:9px}.invoice-summary-grid article{padding:13px}.invoice-summary-grid strong{font-size:17px}.invoice-dialog .invoice-assignment{grid-template-columns:1fr;padding:14px}.invoice-dialog .invoice-positions{padding:16px}}

/* Foundation: a true mobile shell. Desktop tables remain available by horizontal
   scroll; focused tables can opt into compact card styles without clipping data. */
:root{--status-accent:#14624a;--status-ink:#16221c;--status-shadow:0 10px 28px rgba(22,43,32,.06)}
body{background:linear-gradient(135deg,#f8faf9 0,#f4f7f5 56%,#f7faf8 100%);color:var(--status-ink)}
.sidebar{background:linear-gradient(180deg,#101713 0%,#17231d 100%)}
.brand span{background:linear-gradient(145deg,#247358,#124937);box-shadow:0 7px 17px rgba(0,0,0,.2)}
.nav-item{transition:background .18s ease,color .18s ease,transform .18s ease}.nav-item:hover{transform:translateX(2px)}
.panel,.metrics article,.metric-card,.integration-card{box-shadow:var(--status-shadow)}
.primary-button{background:linear-gradient(135deg,#1c7357,#104a38);box-shadow:0 6px 16px rgba(19,82,61,.16);transition:transform .18s ease,box-shadow .18s ease}.primary-button:hover{background:linear-gradient(135deg,#185f49,#0d3d2e);box-shadow:0 9px 20px rgba(19,82,61,.22);transform:translateY(-1px)}
button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible{outline:3px solid rgba(52,140,106,.32);outline-offset:2px}
.bottom-nav,.mobile-settings{display:none}
.source-freshness{display:flex;align-items:center;flex-wrap:wrap;gap:8px 15px;margin:-4px 0 17px;color:#697870;font-size:12px}.source-freshness>div{display:flex;align-items:center;gap:6px}.source-freshness strong{color:#31443a}.source-freshness small{color:#75837c}.source-dot{width:7px;height:7px;border-radius:50%;background:#d09a35}.source-freshness .ready .source-dot{background:#26805d}.source-freshness>a{margin-left:auto;color:#14533e;font-weight:700;text-decoration:none}
@media(max-width:800px){
  body{padding-bottom:78px;background:#f6f8f7}
  .app-shell{min-width:0}
  .sidebar{position:sticky;top:0;z-index:20;padding:13px 18px;background:#111914}
  .sidebar nav{display:none}
  .sidebar .brand{padding:0;display:flex;align-items:center;gap:10px}
  .sidebar .brand span{width:34px;height:34px;display:grid;place-items:center}
  .sidebar .brand small{margin-top:1px}
  .mobile-settings{display:grid;place-items:center;margin-left:auto;width:38px;height:38px;border:1px solid #33423a;border-radius:10px;color:#e8f0ec;text-decoration:none;font-size:18px}
  main{min-width:0;padding:22px 16px 30px}
  main>header{gap:14px;margin-bottom:16px}
  main>header h1{font-size:30px;line-height:1.08}
  .page-subtitle{max-width:30ch;line-height:1.42}
  .period-control{align-self:flex-start}
  .scope-switcher{margin:12px 0 20px;gap:3px;padding:4px}
  .scope-switcher a{min-width:0;padding:10px 7px;font-size:11px}
  .scope-heading{gap:12px;margin-bottom:16px}
  .scope-heading h2{font-size:23px}
  .scope-heading p{line-height:1.45}
  .scope-heading .secondary-button,.scope-heading .primary-button{width:100%;justify-content:center}
  .panel{min-width:0;padding:16px;border-radius:14px}
  .source-freshness{gap:8px 12px;margin-top:0;font-size:11px}.source-freshness>div{gap:5px}.source-freshness small{display:none}.source-freshness>a{margin-left:0}
  .panel-header{gap:10px}
  .panel-header .status{white-space:nowrap}
  .metrics,.metric-grid{gap:11px;margin:14px 0}
  .metrics article,.metric-card{min-height:126px;padding:18px}
  .metrics strong,.metric-card strong{font-size:28px}
  .bottom-nav{position:fixed;z-index:50;right:0;bottom:0;left:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:1px;padding:7px 8px max(7px,env(safe-area-inset-bottom));border-top:1px solid #dbe4de;background:rgba(255,255,255,.96);box-shadow:0 -8px 24px rgba(20,37,29,.08);backdrop-filter:blur(14px)}
  .bottom-nav a{display:grid;place-items:center;gap:3px;min-width:0;padding:5px 2px;border-radius:9px;color:#718078;text-decoration:none;font-weight:700}
  .bottom-nav a span{font-size:18px;line-height:1}
  .bottom-nav a small{overflow:hidden;max-width:100%;font-size:9px;line-height:1.2;text-overflow:ellipsis;white-space:nowrap}
  .bottom-nav a.active{background:#e8f2ed;color:#14533e}
  .inventory-table-wrap{max-width:100%;margin-right:-2px;padding-bottom:3px}
  .inventory-table-wrap table{min-width:640px}
  .ksef-table-panel{overflow:visible}.ksef-table-panel .table-wrap{margin-right:-2px}
  dialog{max-width:calc(100vw - 20px)}
}

/* Runtime QA round 2: these rules stay at the end so theme tokens cannot be
   overridden by legacy module styles. */
:root{--status-bg:#f6f6f4;--status-surface:#fff;--status-surface-alt:#f0f0ed;--status-text:#161616;--status-muted:#6e6e69;--status-line:#e2e2dd;--status-brand:#171717;--status-brand-deep:#000;--status-brand-soft:#eeeeea;--status-shadow:0 14px 34px rgba(0,0,0,.055)}
html[data-theme="light"]{color-scheme:light}html[data-theme="dark"]{color-scheme:dark;--status-bg:#121212;--status-surface:#1b1b1b;--status-surface-alt:#242424;--status-text:#f5f5f2;--status-muted:#aaa9a3;--status-line:#343432;--status-brand:#f5f5f2;--status-brand-deep:#fff;--status-brand-soft:#2a2a28;--status-shadow:0 16px 38px rgba(0,0,0,.25)}
html,body{max-width:100%;overflow-x:hidden}body.status-app,body.status-login{background:var(--status-bg)!important;color:var(--status-text)!important}.panel,.metrics article,.metric-card,.integration-card,.placeholder,.login-card{background:var(--status-surface)!important;border-color:var(--status-line)!important;box-shadow:var(--status-shadow)!important}.panel p,.scope-heading p,.page-subtitle,.integration-copy p{color:var(--status-muted)!important}
input,select,textarea,.form-grid input,.form-grid select,.category-filter select,.inline-form input,.credentials-form input,.period-control select.period,.trend-filter select,.comparison-mode select{background:var(--status-surface)!important;color:var(--status-text)!important;border-color:var(--status-line)!important;color-scheme:inherit}select option{background:var(--status-surface);color:var(--status-text)}select:disabled,input:disabled,textarea:disabled{background:var(--status-surface-alt)!important;color:var(--status-muted)!important;opacity:1}input::placeholder,textarea::placeholder{color:var(--status-muted)!important;opacity:1}select:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid color-mix(in srgb,var(--status-text) 28%,transparent)!important;outline-offset:2px}
html[data-theme="dark"] .inventory-product,html[data-theme="dark"] .inventory-product span:last-child,html[data-theme="dark"] .product-detail-head,html[data-theme="dark"] .product-detail-head h2,html[data-theme="dark"] .inventory-section td{color:var(--status-text)!important}html[data-theme="dark"] .inventory-product{background:transparent!important}html[data-theme="dark"] .inventory-product img{border-color:var(--status-line);background:var(--status-surface-alt)}html[data-theme="dark"] .inventory-section tr{border-color:var(--status-line)}
@media(min-width:801px){.app-shell{align-items:start}.sidebar{position:sticky!important;top:0!important;align-self:start!important;height:100vh!important;min-height:100vh;overflow-y:auto;display:flex;flex-direction:column}.sidebar-tools{margin-top:auto}}
@media(max-width:800px){
  .mobile-app-header{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px;padding:14px max(18px,env(safe-area-inset-right)) 13px max(18px,env(safe-area-inset-left))!important;background:#111!important}.mobile-brand{display:grid!important;flex:1 1 auto;min-width:0;text-decoration:none}.mobile-header-tools{display:flex!important;align-items:center!important;justify-content:flex-end!important;flex:0 0 auto;gap:8px;margin-left:auto}.theme-toggle,.mobile-settings{display:grid!important;place-items:center!important;flex:0 0 40px;width:40px!important;height:40px!important;margin:0!important;border:1px solid rgba(255,255,255,.19)!important;border-radius:12px!important;background:rgba(255,255,255,.08)!important;color:#f5f5f2!important}.theme-toggle svg,.mobile-settings svg{display:block;width:18px;height:18px}.theme-toggle .theme-sun{display:none!important}.theme-toggle .theme-moon{display:grid!important;place-items:center}html[data-theme="dark"] .theme-toggle .theme-sun{display:grid!important;place-items:center}html[data-theme="dark"] .theme-toggle .theme-moon{display:none!important}
  .bottom-nav{grid-template-columns:repeat(4,minmax(0,1fr))!important}.bottom-nav a,.bottom-nav button{color:var(--status-muted)!important}.bottom-nav a.active,.bottom-nav button.active{background:var(--status-brand-soft)!important;color:var(--status-text)!important}
}

/* Runtime QA final pass: semantic monochrome surfaces, a real theme, and
   compact mobile representations. These rules intentionally come last so
   every established module inherits the same system without changing data. */
:root{--status-bg:#f6f6f4;--status-surface:#fff;--status-surface-alt:#f0f0ed;--status-text:#161616;--status-muted:#6e6e69;--status-line:#e2e2dd;--status-brand:#171717;--status-brand-deep:#000;--status-brand-soft:#eeeeea;--status-shadow:0 14px 34px rgba(0,0,0,.055);--status-radius:18px;--status-radius-sm:12px}
html[data-theme="dark"]{--status-bg:#121212;--status-surface:#1b1b1b;--status-surface-alt:#242424;--status-text:#f5f5f2;--status-muted:#aaa9a3;--status-line:#343432;--status-brand:#f5f5f2;--status-brand-deep:#fff;--status-brand-soft:#2a2a28;--status-shadow:0 16px 38px rgba(0,0,0,.25)}
html,body{max-width:100%;overflow-x:hidden}body.status-app,body.status-login{background:var(--status-bg);color:var(--status-text)}
body.status-app{background-image:none}.panel,.metrics article,.metric-card,.integration-card,.placeholder,.login-card{background:var(--status-surface);border-color:var(--status-line);box-shadow:var(--status-shadow)}
.sidebar,.mobile-app-header{background:#111!important}.sidebar{background-image:none!important}.nav-item:hover,.nav-item.active{background:#2a2a2a!important}.nav-item.active{box-shadow:inset 3px 0 #eee!important}.brand small,.mobile-brand small{color:#a6a6a0!important}.sidebar-note{color:#95958f!important}.sidebar-note a{color:#f3f3ef!important}
.sidebar-tools{margin-top:auto;padding:20px 10px 10px}.theme-toggle,.mobile-settings{display:grid!important;place-items:center;width:40px;height:40px;margin:0;border:1px solid rgba(255,255,255,.19)!important;border-radius:12px!important;background:rgba(255,255,255,.08)!important;color:#f5f5f2!important;box-shadow:none!important;cursor:pointer}.theme-toggle svg,.mobile-settings svg{width:18px;height:18px}.theme-toggle .theme-moon{display:none}.theme-toggle .theme-sun{display:grid;place-items:center}.theme-toggle span{line-height:0}html[data-theme="dark"] .theme-toggle .theme-sun{display:none}html[data-theme="dark"] .theme-toggle .theme-moon{display:grid;place-items:center}
.primary-button{background:#171717!important;color:#fff!important;box-shadow:none!important}.primary-button:hover{background:#000!important}.secondary-button,.icon-button{background:var(--status-surface-alt)!important;color:var(--status-text)!important}.scope-switcher a.active,.scope-switcher button.active,.bottom-nav a.active,.bottom-nav button.active{background:var(--status-brand-soft)!important;color:var(--status-text)!important}.scope-switcher,.source-freshness{background:var(--status-surface)!important;border-color:var(--status-line)!important}.source-freshness strong,.source-freshness>a,.link-button{color:var(--status-text)!important}
input,select,textarea,.form-grid input,.form-grid select,.category-filter select,.inline-form input,.credentials-form input{background:var(--status-surface)!important;color:var(--status-text)!important;border-color:var(--status-line)!important}.panel p,.scope-heading p,.page-subtitle,.integration-copy p{color:var(--status-muted)!important}.metrics .profit{background:#171717!important;border-color:#171717!important}.metrics .profit p,.metrics .profit small{color:#c8c8c3!important}html[data-theme="dark"] .metrics .profit{background:#eee!important;border-color:#eee!important}html[data-theme="dark"] .metrics .profit p,html[data-theme="dark"] .metrics .profit strong,html[data-theme="dark"] .metrics .profit small{color:#111!important}
html[data-theme="dark"] .status-app table tr,html[data-theme="dark"] .status-app td{border-color:var(--status-line)}html[data-theme="dark"] .status-app .allocation-note,html[data-theme="dark"] .status-app .integration-note{background:var(--status-surface-alt)}html[data-theme="dark"] .status-app .tag,html[data-theme="dark"] .status-app .status{background:#2c2c2a;color:#e9e9e4}
.login-logo-pair .logo-on-dark{display:none}html[data-theme="dark"] .status-login .login-card{background:#1a1a1a}html[data-theme="dark"] .status-login .logo-on-light{display:none}html[data-theme="dark"] .status-login .logo-on-dark{display:block}html[data-theme="dark"] .status-login{background:#121212}.status-login{background:#f6f6f4!important}.login-card{border-radius:24px!important}.login-logo-pair{display:flex;justify-content:center}.login-logo{margin-left:auto!important;margin-right:auto!important}
.shortcut-settings-form{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) auto;align-items:end;gap:14px;margin-top:18px}.shortcut-settings-form label{display:grid;gap:7px;color:var(--status-muted);font-size:12px;font-weight:750}.shortcut-settings-form .primary-button{white-space:nowrap}.mobile-navigation-settings{margin-top:20px}
@media(max-width:800px){
  .mobile-app-header{position:relative;z-index:30;padding-right:max(18px,env(safe-area-inset-right))!important}.mobile-brand{text-decoration:none}.mobile-header-tools{display:flex;align-items:center;gap:8px}.mobile-settings{font-size:0!important}.mobile-settings svg{display:block}.theme-toggle{flex:0 0 auto}
  .bottom-nav{background:color-mix(in srgb,var(--status-surface) 92%,transparent)!important;border-color:var(--status-line)!important}.bottom-nav a,.bottom-nav button{color:var(--status-muted)!important}.bottom-nav button span{font-size:17px!important}.bottom-nav small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .mobile-more-sheet{background:var(--status-surface)!important;color:var(--status-text)!important}.sheet-handle{background:var(--status-line)!important}.sheet-launcher{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important}.mobile-more-sheet .sheet-launcher a{display:flex!important;align-items:center;gap:11px;padding:14px 12px!important;border:1px solid var(--status-line);border-radius:14px!important;background:var(--status-surface-alt);color:var(--status-text)!important}.sheet-launcher svg{width:19px;height:19px;flex:0 0 auto}.sheet-launcher .sheet-logout{color:#a44338!important}.sheet-close{font-size:22px!important}
  .shortcut-settings-form{grid-template-columns:1fr;gap:12px}.shortcut-settings-form .primary-button{width:100%;justify-content:center}
  .table-panel,.ksef-table-panel,.inventory-section{overflow:hidden}.table-panel table:has(thead),.ksef-table-panel table:has(thead),.inventory-section table:has(thead){width:100%!important;max-width:100%!important}.table-panel table:has(thead) tr,.ksef-table-panel table:has(thead) tr,.inventory-section table:has(thead) tr{max-width:100%;overflow:hidden}.table-panel table:has(thead) td,.ksef-table-panel table:has(thead) td,.inventory-section table:has(thead) td{grid-template-columns:minmax(76px,.72fr) minmax(0,1.28fr)!important;min-width:0;word-break:break-word}.table-panel table:has(thead) td>* ,.ksef-table-panel table:has(thead) td>* ,.inventory-section table:has(thead) td>*{min-width:0;max-width:100%}.finance-summary{display:grid!important;grid-template-columns:1fr 1fr;gap:9px}.finance-summary span{min-width:0;overflow-wrap:anywhere}.cost-form{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px;width:100%}.cost-form .secondary-button{width:100%;justify-content:center}
}

/* Status Foundation — shared visual system. It deliberately reuses existing
   semantic classes so the financial and integration modules retain behaviour. */
:root{
  --status-bg:#f5f7f6;--status-surface:#fff;--status-text:#14201a;--status-muted:#68766f;
  --status-line:#e2e9e5;--status-brand:#126047;--status-brand-deep:#0d3d2e;
  --status-brand-soft:#e8f3ed;--status-danger:#b24f42;--status-warning:#9c701b;
  --status-radius:20px;--status-radius-sm:13px;--status-shadow:0 12px 32px rgba(17,38,28,.055);
}
body.status-app{background:var(--status-bg);font-size:14px;letter-spacing:-.01em}
.app-shell{grid-template-columns:264px minmax(0,1fr)}
.sidebar{padding:28px 18px;background:#102019}
.brand{display:block;padding:4px 10px 32px}
.brand img{display:block;width:116px;height:auto;max-height:34px;object-fit:contain;object-position:left center}
.brand small{margin-top:11px;color:#93a79d;font-size:11px;font-weight:650;letter-spacing:.02em}
.sidebar nav{gap:5px}.nav-item{padding:12px 13px;border-radius:11px;color:#b9c8c0;font-weight:650}
.nav-item:hover,.nav-item.active{background:#1d3329;color:#fff;transform:none}.nav-item.active{box-shadow:inset 3px 0 #76c2a3}
.sidebar-note{line-height:1.6;color:#8da298}.sidebar-note a{color:#d6e5dc;text-decoration:none}
main{max-width:1440px;padding:48px 56px 72px}
header{align-items:flex-start;margin-bottom:4px}h1{font-size:34px;line-height:1.08;letter-spacing:-.045em}h2{font-size:24px;letter-spacing:-.035em}h3{font-size:17px;letter-spacing:-.025em}
.eyebrow{color:#718078;font-size:10px;font-weight:800;letter-spacing:.13em}.page-subtitle{max-width:58ch;margin-top:9px;color:var(--status-muted);font-size:15px}
.period-control label{display:grid;gap:5px;color:#718078;font-size:10px;font-weight:800;letter-spacing:.1em;text-transform:uppercase}.period{min-width:180px;border-color:var(--status-line);border-radius:11px;padding:10px 12px;font-size:14px;font-weight:700;letter-spacing:0;text-transform:none;box-shadow:0 1px 1px rgba(16,32,25,.02)}
.scope-switcher{margin:34px 0 30px;padding:5px;border-color:var(--status-line);border-radius:14px;box-shadow:0 2px 5px rgba(17,38,28,.025)}.scope-switcher a,.scope-switcher button{padding:10px 18px;border-radius:10px;font-size:11px;letter-spacing:.04em}.scope-switcher a.active,.scope-switcher button.active{background:var(--status-brand-soft);color:var(--status-brand-deep)}
.scope-heading{margin-bottom:20px}.scope-heading p,.panel p{color:var(--status-muted);line-height:1.5}
.panel,.metrics article,.metric-card,.integration-card,.placeholder{border-color:var(--status-line);border-radius:var(--status-radius);box-shadow:var(--status-shadow)}
.panel{padding:24px}.metrics{gap:18px}.metrics article{min-height:166px;padding:24px}.metrics strong{margin:10px 0 7px;font-size:34px;letter-spacing:-.045em}.metrics .profit{background:linear-gradient(140deg,#123c2d,#0c2c21);border-color:#0c2c21}.metrics .profit p,.metrics .profit small{color:#b9d0c4}
.primary-button,.secondary-button,.icon-button{min-height:42px;border-radius:12px;padding:10px 16px;font-weight:750}.primary-button{background:var(--status-brand);box-shadow:0 7px 18px rgba(18,96,71,.16)}.primary-button:hover{background:var(--status-brand-deep)}.secondary-button{background:#edf2ef;color:#254238}.status,.tag{padding:5px 9px;border-radius:999px;font-size:11px;font-weight:750}.allocation-note{border-radius:var(--status-radius-sm);border-left-color:var(--status-brand);background:var(--status-brand-soft)}
input,select,textarea,.form-grid input,.form-grid select,.category-filter select,.inline-form input,.credentials-form input{border-color:#d7e2dc!important;border-radius:11px!important;background:#fff!important;box-shadow:0 1px 1px rgba(16,32,25,.02)}
table{margin-top:18px}th{padding:13px 10px;color:#78857e;font-size:10px;font-weight:800;letter-spacing:.09em}td{padding:15px 10px;border-color:#edf1ee}th:first-child,td:first-child{padding-left:0}th:last-child,td:last-child{padding-right:0}.table-panel{padding-bottom:15px}.inventory-table-wrap{border-radius:12px}.link-button{color:var(--status-brand)}
.source-freshness{margin:0 0 20px;padding:11px 14px;border:1px solid var(--status-line);border-radius:13px;background:rgba(255,255,255,.7)}.source-freshness>a{color:var(--status-brand)}
.mobile-more-sheet{display:none}.bottom-nav{display:none}
.mobile-app-header{display:none}
.archive-panel{padding:0;overflow:hidden}.archive-panel>summary{display:flex;align-items:center;gap:14px;padding:24px;cursor:pointer;list-style:none}.archive-panel>summary::-webkit-details-marker{display:none}.archive-panel>summary::after{content:'⌄';display:grid;flex:0 0 auto;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--status-brand-soft);color:var(--status-brand-deep);font-weight:800;transition:transform .18s ease}.archive-panel[open]>summary::after{transform:rotate(180deg)}.archive-panel .archive-disclosure{margin-left:auto;color:var(--status-brand);font-size:12px;font-weight:750;white-space:nowrap}.archive-panel[open] .archive-disclosure{font-size:0}.archive-panel[open] .archive-disclosure::after{content:'Ukryj historię';font-size:12px}.archive-panel .table-wrap{padding:0 24px 18px}
.status-form{position:relative}.status-form.is-saving{opacity:.68}.status-form .status-feedback{display:block;min-height:16px;margin-top:5px;color:var(--status-brand);font-size:11px;font-weight:700;line-height:1.3}.status-form.has-error .status-feedback{color:var(--status-danger)}

/* A minimalist, branded login that uses the supplied Status artwork. */
.status-login{display:grid;min-height:100vh;place-items:center;padding:28px;background:radial-gradient(circle at 82% 14%,#dceee5 0,transparent 27%),#f4f7f5}
.login-card{width:min(430px,100%);min-height:auto;padding:38px;border:1px solid var(--status-line);border-radius:24px;background:rgba(255,255,255,.94);box-shadow:0 22px 60px rgba(17,38,28,.1)}
.login-logo{display:block;width:146px;height:auto;margin:0 0 30px}.login-card h1{margin:8px 0 10px;font-size:34px}.login-card>p:not(.eyebrow):not(.error){color:var(--status-muted);font-size:15px}.login-form{display:grid;margin-top:27px;gap:15px}.login-form label{display:grid;gap:7px;color:#405148;font-size:12px;font-weight:750}.login-form input{padding:12px}.login-form button{margin-top:4px}.error{color:var(--status-danger)!important}

@media(max-width:800px){
  body.status-app{padding-bottom:82px}.app-shell{display:block!important}.desktop-sidebar{display:none!important}.mobile-app-header{display:flex;align-items:center;justify-content:space-between;padding:14px max(18px,env(safe-area-inset-right)) 13px max(18px,env(safe-area-inset-left));background:#102019}.mobile-brand{display:grid;gap:4px;min-width:0}.mobile-brand img{display:block;width:101px;height:auto;max-height:28px;object-fit:contain;object-position:left center}.mobile-brand small{color:#afc1b7;font-size:10px;font-weight:650;letter-spacing:.02em}.mobile-settings{display:grid!important;place-items:center;flex:0 0 auto;width:40px;height:40px;margin:0;border:1px solid #334b3f;border-radius:12px;color:#eef6f1;text-decoration:none;font-size:19px;line-height:1}
  main{padding:25px max(18px,env(safe-area-inset-right)) 28px max(18px,env(safe-area-inset-left))!important}header,.scope-heading,.panel-header{gap:13px!important}header h1{font-size:31px!important}.page-subtitle{font-size:14px}.period-control{width:100%}.period-control label{width:100%}.period{width:100%}.scope-switcher{margin:20px 0 24px!important}.scope-switcher a{padding:11px 5px!important}
  .panel,.metrics article,.metric-card{padding:18px!important;border-radius:17px!important}.metrics{gap:12px!important}.metrics article{min-height:0}.metrics strong{font-size:30px!important}.source-freshness{display:grid;grid-template-columns:1fr 1fr;margin-bottom:15px}.source-freshness>a{grid-column:1/-1;margin:0}.source-freshness small{display:block!important}
  .bottom-nav{position:fixed;z-index:70;right:0;bottom:0;left:0;display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:2px;padding:8px max(9px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(9px,env(safe-area-inset-left));border-top:1px solid #dce6e0;background:rgba(255,255,255,.96);box-shadow:0 -10px 28px rgba(14,38,27,.09);backdrop-filter:blur(16px)}
  .bottom-nav a,.bottom-nav button{display:grid;place-items:center;gap:4px;min-width:0;padding:6px 2px;border:0;border-radius:11px;background:transparent;color:#6a7971;font:750 10px/1.1 inherit;text-decoration:none}.bottom-nav a span,.bottom-nav button span{font-size:17px;line-height:1}.bottom-nav a.active,.bottom-nav button.active{background:var(--status-brand-soft);color:var(--status-brand-deep)}
  .mobile-more-sheet[open]{display:block}.mobile-more-sheet{width:100%;max-width:none;height:auto;max-height:74dvh;margin:auto 0 0;padding:12px 18px calc(24px + env(safe-area-inset-bottom));border:0;border-radius:24px 24px 0 0;background:#fff;box-shadow:0 -20px 60px rgba(10,27,19,.19)}.mobile-more-sheet::backdrop{background:rgba(10,24,18,.36)}.sheet-handle{width:40px;height:4px;margin:0 auto 15px;border-radius:999px;background:#dbe4de}.sheet-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.sheet-header strong{font-size:19px}.mobile-more-sheet nav{display:grid;gap:4px}.mobile-more-sheet nav a{padding:15px 12px;border-radius:12px;color:var(--status-text);font-weight:720;text-decoration:none}.mobile-more-sheet nav a:hover{background:#f0f5f2}.mobile-more-sheet .sheet-logout{color:var(--status-danger)}
  .archive-panel>summary{align-items:flex-start;padding:18px}.archive-panel>summary .pill{margin-top:2px}.archive-panel .archive-disclosure{display:none}.archive-panel .table-wrap{padding:0 18px 16px}
  .table-wrap,.inventory-table-wrap,.ksef-table-panel .table-wrap{overflow:visible!important;padding:0!important}.table-panel table:has(thead),.ksef-table-panel table:has(thead),.inventory-section table:has(thead){min-width:0!important;margin-top:13px}.table-panel table:has(thead) thead,.ksef-table-panel table:has(thead) thead,.inventory-section table:has(thead) thead{display:none}.table-panel table:has(thead) tbody,.ksef-table-panel table:has(thead) tbody,.inventory-section table:has(thead) tbody{display:grid;gap:9px}.table-panel table:has(thead) tr,.ksef-table-panel table:has(thead) tr,.inventory-section table:has(thead) tr{display:block;padding:12px;border:1px solid #e4ece7;border-radius:13px;background:#fff}.table-panel table:has(thead) td,.ksef-table-panel table:has(thead) td,.inventory-section table:has(thead) td{display:grid;grid-template-columns:minmax(95px,.78fr) minmax(0,1.22fr);gap:10px;padding:7px 0!important;border:0!important;text-align:left!important;overflow-wrap:anywhere}.table-panel table:has(thead) td::before,.ksef-table-panel table:has(thead) td::before,.inventory-section table:has(thead) td::before{content:attr(data-label);color:#77847d;font-size:10px;font-weight:800;letter-spacing:.07em;text-transform:uppercase}.table-panel table:has(thead) td:last-child,.ksef-table-panel table:has(thead) td:last-child,.inventory-section table:has(thead) td:last-child{padding-bottom:0!important}.table-panel table:has(thead) td:first-child,.ksef-table-panel table:has(thead) td:first-child,.inventory-section table:has(thead) td:first-child{padding-top:0!important}.cost-form,.salon-stock-form{min-width:0!important;justify-content:flex-start}.cost-form input{width:100%!important}.inventory-section .inventory-compact th:first-child,.inventory-section .inventory-compact td:first-child,.inventory-section .inventory-compact .inventory-product{width:auto!important;min-width:0!important}.invoice-dialog .invoice-positions table:has(thead){min-width:520px!important}.invoice-dialog .invoice-positions .table-wrap{overflow-x:auto!important}.invoice-dialog .invoice-positions table:has(thead) thead{display:table-header-group}.invoice-dialog .invoice-positions table:has(thead) tbody{display:table-row-group}.invoice-dialog .invoice-positions table:has(thead) tr{display:table-row;padding:0;border:0;border-radius:0}.invoice-dialog .invoice-positions table:has(thead) td{display:table-cell;padding:14px 16px!important;border-bottom:1px solid var(--status-line)!important}.invoice-dialog .invoice-positions table:has(thead) td::before{display:none}
  .status-login{align-items:start;padding:30px 16px}.login-card{width:100%;margin:0;padding:29px 22px;border-radius:21px}.login-card h1{font-size:31px!important}.login-logo{width:132px;margin-bottom:26px}
}

/* Runtime QA round 2 final precedence. */
:root{--status-bg:#f6f6f4;--status-surface:#fff;--status-surface-alt:#f0f0ed;--status-text:#161616;--status-muted:#6e6e69;--status-line:#e2e2dd;--status-brand:#171717;--status-brand-deep:#000;--status-brand-soft:#eeeeea;--status-shadow:0 14px 34px rgba(0,0,0,.055)}
html[data-theme="light"]{color-scheme:light}html[data-theme="dark"]{color-scheme:dark;--status-bg:#121212;--status-surface:#1b1b1b;--status-surface-alt:#242424;--status-text:#f5f5f2;--status-muted:#aaa9a3;--status-line:#343432;--status-brand:#f5f5f2;--status-brand-deep:#fff;--status-brand-soft:#2a2a28;--status-shadow:0 16px 38px rgba(0,0,0,.25)}
html,body{max-width:100%;overflow-x:hidden}body.status-app,body.status-login{background:var(--status-bg)!important;color:var(--status-text)!important}.panel,.metrics article,.metric-card,.integration-card,.placeholder,.login-card{background:var(--status-surface)!important;border-color:var(--status-line)!important;box-shadow:var(--status-shadow)!important}.panel p,.scope-heading p,.page-subtitle,.integration-copy p{color:var(--status-muted)!important}
input,select,textarea,.form-grid input,.form-grid select,.category-filter select,.inline-form input,.credentials-form input,.period-control select.period,.trend-filter select,.comparison-mode select{background:var(--status-surface)!important;color:var(--status-text)!important;border-color:var(--status-line)!important;color-scheme:inherit}select option{background:var(--status-surface);color:var(--status-text)}select:disabled,input:disabled,textarea:disabled{background:var(--status-surface-alt)!important;color:var(--status-muted)!important;opacity:1}input::placeholder,textarea::placeholder{color:var(--status-muted)!important;opacity:1}select:focus-visible,input:focus-visible,textarea:focus-visible{outline:3px solid color-mix(in srgb,var(--status-text) 28%,transparent)!important;outline-offset:2px}
html[data-theme="dark"] .inventory-product,html[data-theme="dark"] .inventory-product span:last-child,html[data-theme="dark"] .product-detail-head,html[data-theme="dark"] .product-detail-head h2,html[data-theme="dark"] .inventory-section td{color:var(--status-text)!important}html[data-theme="dark"] .inventory-product{background:transparent!important}html[data-theme="dark"] .inventory-product img{border-color:var(--status-line);background:var(--status-surface-alt)}html[data-theme="dark"] .inventory-section tr{border-color:var(--status-line)}
@media(min-width:801px){.app-shell{align-items:start}.sidebar{position:sticky!important;top:0!important;align-self:start!important;height:100vh!important;min-height:100vh;overflow-y:auto;display:flex;flex-direction:column}.sidebar-tools{margin-top:auto}}
@media(max-width:800px){.mobile-app-header{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px;padding:14px max(18px,env(safe-area-inset-right)) 13px max(18px,env(safe-area-inset-left))!important;background:#111!important}.mobile-brand{display:grid!important;flex:1 1 auto;min-width:0;text-decoration:none}.mobile-header-tools{display:flex!important;align-items:center!important;justify-content:flex-end!important;flex:0 0 auto;gap:8px;margin-left:auto}.theme-toggle,.mobile-settings{display:grid!important;place-items:center!important;flex:0 0 40px;width:40px!important;height:40px!important;margin:0!important;border:1px solid rgba(255,255,255,.19)!important;border-radius:12px!important;background:rgba(255,255,255,.08)!important;color:#f5f5f2!important}.theme-toggle svg,.mobile-settings svg{display:block;width:18px;height:18px}.theme-toggle .theme-sun{display:none!important}.theme-toggle .theme-moon{display:grid!important;place-items:center}html[data-theme="dark"] .theme-toggle .theme-sun{display:grid!important;place-items:center}html[data-theme="dark"] .theme-toggle .theme-moon{display:none!important}.bottom-nav{grid-template-columns:repeat(4,minmax(0,1fr))!important}.bottom-nav a,.bottom-nav button{color:var(--status-muted)!important}.bottom-nav a.active,.bottom-nav button.active{background:var(--status-brand-soft)!important;color:var(--status-text)!important}}

/* Runtime QA round 3: desktop tables become self-contained cards on phones. */
.mobile-sort-control{display:none}
.sortable-heading{cursor:pointer}.sortable-heading::after{content:'↕';display:inline-block;margin-left:6px;color:var(--status-muted);font-size:12px}.sortable-heading[data-order="asc"]::after{content:'↑';color:var(--status-text)}.sortable-heading[data-order="desc"]::after{content:'↓';color:var(--status-text)}
.imports-stack{display:grid;gap:24px;margin-top:26px}.imports-stack .import-card{max-width:none}.archive-panel[open] .archive-disclosure::after{content:'Ukryj'}
@media(min-width:801px){.sidebar{position:fixed!important;inset:0 auto 0 0!important;width:264px!important;height:100vh!important;min-height:100vh!important;overflow-y:auto!important}.app-shell{grid-template-columns:264px minmax(0,1fr)!important}.sidebar-tools{margin-top:auto}}

/* Runtime QA round 5 -----------------------------------------------------
   A fixed sidebar is intentionally outside normal document flow. It must
   therefore not share an auto-placement CSS grid with main: that would place
   main in the former sidebar column. Desktop uses an explicit sidebar offset;
   the mobile media rules above keep their independent single-column layout. */
:root{
  --status-action-bg:#151515;
  --status-action-text:#fff;
  --status-action-hover:#000;
  --status-action-focus:rgba(21,21,21,.34);
  --status-surface-alt:#f0f0ed;
}
html[data-theme="dark"]{
  --status-action-bg:#f5f5f2;
  --status-action-text:#151515;
  --status-action-hover:#fff;
  --status-action-focus:rgba(245,245,242,.42);
}
@media(min-width:801px){
  .app-shell{display:block!important;min-width:0!important}
  .sidebar{position:fixed!important;inset:0 auto 0 0!important;width:264px!important;height:100vh!important;min-height:100vh!important;overflow-y:auto!important}
  .app-shell>main{box-sizing:border-box!important;width:calc(100vw - 264px)!important;max-width:none!important;min-width:0!important;margin:0 0 0 264px!important;padding:48px 56px 72px!important}
}

/* Primary actions are monochrome; green, red and amber remain semantic data. */
.primary-button{
  background:var(--status-action-bg)!important;
  color:var(--status-action-text)!important;
  border-color:var(--status-action-bg)!important;
  box-shadow:none!important;
}
.primary-button:hover,.primary-button:focus{
  background:var(--status-action-hover)!important;
  color:var(--status-action-text)!important;
  border-color:var(--status-action-hover)!important;
  box-shadow:0 0 0 3px var(--status-action-focus)!important;
  outline:0!important;
}
.primary-button:disabled{
  opacity:.48!important;
  cursor:not-allowed!important;
  box-shadow:none!important;
}

/* KSeF actions must retain contrast on both semantic surfaces. */
.ksef-table-panel .ksef-details .link-button{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:var(--status-surface-alt)!important;
  color:var(--status-text)!important;
  border:1px solid var(--status-line)!important;
}
.ksef-table-panel .ksef-details .link-button:hover,
.ksef-table-panel .ksef-details .link-button:focus{
  background:var(--status-brand-soft)!important;
  color:var(--status-text)!important;
  border-color:var(--status-line)!important;
  outline:2px solid var(--status-text)!important;
  outline-offset:2px!important;
}

/* Product-price cards deliberately stay light inside a dark dialog. Their
   text is assigned to their real surface instead of inheriting dark text. */
html[data-theme="dark"] dialog{background:var(--status-surface)!important;color:var(--status-text)!important;border-color:var(--status-line)!important}
html[data-theme="dark"] dialog .dialog-header h2,
html[data-theme="dark"] dialog .product-detail-head,
html[data-theme="dark"] dialog .product-detail-head p{color:var(--status-text)!important}
html[data-theme="dark"] dialog .price-card:not(.margin-card),
html[data-theme="dark"] dialog .purchase-card,
html[data-theme="dark"] dialog .woo-card,
html[data-theme="dark"] dialog .product-note{
  background:#f7f8f7!important;
  color:#14201a!important;
  border-color:#dce4df!important;
}
html[data-theme="dark"] dialog .price-card:not(.margin-card)>span,
html[data-theme="dark"] dialog .price-card:not(.margin-card)>strong,
html[data-theme="dark"] dialog .price-card:not(.margin-card) p,
html[data-theme="dark"] dialog .price-card:not(.margin-card) em,
html[data-theme="dark"] dialog .product-note{color:#4d5b53!important}
html[data-theme="dark"] dialog .price-card:not(.margin-card) b{color:#14201a!important}
html[data-theme="dark"] dialog .purchase-card label,
html[data-theme="dark"] dialog .purchase-card input{
  background:#fff!important;
  color:#14201a!important;
  border-color:#cfd7d2!important;
}
html[data-theme="dark"] dialog .purchase-card label small{color:#526158!important}
html[data-theme="dark"] dialog .margin-card{background:#153b2d!important;border-color:#153b2d!important}
html[data-theme="dark"] dialog .margin-card>span,
html[data-theme="dark"] dialog .margin-card>strong,
html[data-theme="dark"] dialog .margin-card p{color:#cfe2d8!important}
html[data-theme="dark"] dialog .margin-card b{color:#fff!important}
html[data-theme="dark"] dialog .icon-button{background:var(--status-surface-alt)!important;color:var(--status-text)!important;border:1px solid var(--status-line)!important}

/* Trend keeps its data and scale, but removes the old filled column tracks. */
.trend-panel{overflow:hidden}
.trend-chart{
  height:232px!important;
  gap:16px!important;
  padding:20px 4px 0!important;
  border-bottom:0!important;
  background:transparent!important;
}
.trend-column{min-width:0!important;grid-template-rows:28px 1fr 24px!important}
.trend-track{
  position:relative!important;
  background:transparent!important;
  border-radius:0!important;
  border-bottom:1px solid var(--status-line)!important;
  overflow:visible!important;
}
.trend-track i{width:min(32px,64%)!important;border-radius:6px 6px 0 0!important}
.trend-track i.positive{background:#28775a!important}
.trend-track i.negative{background:#bd574b!important}
.trend-value{color:var(--status-text)!important}
.trend-column small,.trend-note{color:var(--status-muted)!important}
@media(max-width:800px){
  .trend-chart{height:198px!important;gap:7px!important;padding-top:16px!important}
  .trend-track i{width:min(22px,68%)!important}
}
html[data-theme="dark"] .ksef-table-panel,html[data-theme="dark"] .ksef-table-panel td,html[data-theme="dark"] .ksef-table-panel h3,html[data-theme="dark"] .ksef-table-panel .ksef-supplier,html[data-theme="dark"] .ksef-table-panel .ksef-number,html[data-theme="dark"] .ksef-table-panel .ksef-date,html[data-theme="dark"] .ksef-table-panel .ksef-due{color:var(--status-text)!important}html[data-theme="dark"] .ksef-table-panel .panel-title p,html[data-theme="dark"] .ksef-table-panel .status-note,html[data-theme="dark"] .ksef-table-panel td::before{color:var(--status-muted)!important}html[data-theme="dark"] .ksef-table-panel .pill{background:var(--status-surface-alt)!important;color:var(--status-text)!important;border:1px solid var(--status-line)!important}html[data-theme="dark"] .ksef-table-panel .warning-pill{background:transparent!important;color:#e4b755!important;border-color:transparent!important}html[data-theme="dark"] .ksef-table-panel .payment-status{background:var(--status-surface-alt)!important;color:var(--status-text)!important;border:1px solid var(--status-line)!important}html[data-theme="dark"] .ksef-table-panel .ksef-details .link-button{background:var(--status-brand-soft)!important;color:var(--status-text)!important;border-color:var(--status-line)!important}
@media(max-width:800px){
  .mobile-settings{display:none!important}.mobile-brand small{display:none!important}.ksef-table-panel .warning-pill{display:inline!important;background:transparent!important;color:var(--status-warning)!important;padding:0!important;border:0!important;font-size:12px!important;font-weight:800!important;box-shadow:none!important}
  .imports-stack{gap:16px;margin-top:18px}.imports-stack .archive-panel>summary{padding:18px!important}.imports-stack .inventory-table-wrap{padding:0 18px 18px!important}
  .finance-filter-row{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:12px!important;width:100%!important}.finance-filters{display:flex!important;flex-wrap:wrap!important;gap:8px!important}.finance-filters button{flex:1 1 auto!important;min-width:0!important;white-space:normal!important;min-height:40px!important}.category-filter{min-width:0!important;width:100%!important}
  .mobile-sort-control{display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;align-items:center!important;gap:9px!important;width:100%!important;margin:14px 0 3px!important;color:var(--status-muted)!important;font-size:12px!important;font-weight:750!important}.mobile-sort-control select{min-width:0!important;width:100%!important;padding:10px 11px!important;font:650 13px inherit!important}
  .table-panel,.ksef-table-panel,.inventory-section{overflow:visible!important}.table-panel .inventory-table-wrap,.ksef-table-panel .table-wrap,.inventory-section .inventory-table-wrap{overflow:visible!important;width:100%!important;max-width:100%!important;padding:0!important}
  table.mobile-card-table,.table-panel table:has(thead),.ksef-table-panel table:has(thead),.inventory-section table:has(thead),.table-panel .inventory-table-wrap table.mobile-card-table,.inventory-section .inventory-table-wrap table.mobile-card-table,.ksef-table-panel .table-wrap table.mobile-card-table{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;table-layout:auto!important;margin:12px 0 0!important}
  table.mobile-card-table thead,.table-panel table:has(thead) thead,.ksef-table-panel table:has(thead) thead,.inventory-section table:has(thead) thead{display:none!important}
  table.mobile-card-table tbody,.table-panel table:has(thead) tbody,.ksef-table-panel table:has(thead) tbody,.inventory-section table:has(thead) tbody{display:grid!important;gap:10px!important;width:100%!important}
  table.mobile-card-table tbody tr,.table-panel table:has(thead) tbody tr,.ksef-table-panel table:has(thead) tbody tr,.inventory-section table:has(thead) tbody tr{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;padding:14px!important;border:1px solid var(--status-line)!important;border-radius:14px!important;background:var(--status-surface)!important;box-sizing:border-box!important;overflow:visible!important}
  table.mobile-card-table tbody td,.table-panel table:has(thead) tbody td,.ksef-table-panel table:has(thead) tbody td,.inventory-section table:has(thead) tbody td{display:grid!important;grid-template-columns:minmax(0,42%) minmax(0,58%)!important;align-items:start!important;gap:10px!important;width:100%!important;min-width:0!important;max-width:100%!important;padding:8px 0!important;border:0!important;text-align:left!important;white-space:normal!important;overflow:visible!important;box-sizing:border-box!important;overflow-wrap:anywhere!important;word-break:normal!important}
  table.mobile-card-table tbody td::before,.table-panel table:has(thead) tbody td::before,.ksef-table-panel table:has(thead) tbody td::before,.inventory-section table:has(thead) tbody td::before{content:attr(data-label)!important;display:block!important;min-width:0!important;color:var(--status-muted)!important;font-size:10px!important;font-weight:800!important;letter-spacing:.07em!important;line-height:1.35!important;text-transform:uppercase!important}
  table.mobile-card-table tbody td:last-child,.table-panel table:has(thead) tbody td:last-child,.ksef-table-panel table:has(thead) tbody td:last-child,.inventory-section table:has(thead) tbody td:last-child{padding-bottom:0!important}table.mobile-card-table tbody td:first-child,.table-panel table:has(thead) tbody td:first-child,.ksef-table-panel table:has(thead) tbody td:first-child,.inventory-section table:has(thead) tbody td:first-child{padding-top:0!important}
  table.mobile-card-table tbody td>* ,.table-panel table:has(thead) tbody td>* ,.ksef-table-panel table:has(thead) tbody td>* ,.inventory-section table:has(thead) tbody td>*{min-width:0!important;max-width:100%!important}
  .empty-row{display:block!important;text-align:left!important}.empty-row::before{display:none!important}
  .row-actions{display:flex!important;flex-wrap:wrap!important;justify-content:flex-start!important;gap:10px!important}.row-actions::before{display:none!important}.row-actions form{min-width:0!important}.source-lock{display:inline!important}.finance-gross{font-size:16px!important;overflow-wrap:normal!important}
  .inventory-section .inventory-compact tbody td:first-child{display:block!important}.inventory-section .inventory-compact tbody td:first-child::before{margin-bottom:8px!important}.inventory-section .inventory-compact .inventory-product{display:flex!important;align-items:flex-start!important;width:100%!important;min-width:0!important;gap:11px!important}.inventory-section .inventory-compact .inventory-product img,.inventory-section .inventory-compact .product-placeholder{flex:0 0 44px!important;width:44px!important;height:44px!important}.inventory-section .inventory-compact .inventory-product span:last-child{display:block!important;flex:1 1 auto!important;min-width:0!important;max-width:none!important;overflow-wrap:anywhere!important;word-break:normal!important;white-space:normal!important;line-height:1.35!important}.inventory-section .inventory-compact td:last-child{display:block!important}.inventory-section .inventory-compact td:last-child::before{display:none!important}.inventory-section .inventory-compact td:last-child .link-button{display:inline-flex!important;min-width:104px!important;min-height:38px!important;align-items:center!important;justify-content:center!important;white-space:nowrap!important}
  .ksef-table-panel .panel-title,.ksef-table-panel.archive-panel>summary{display:flex!important;flex-wrap:wrap!important;gap:9px!important;min-width:0!important}.ksef-table-panel .panel-title>div{min-width:0!important;flex:1 1 180px!important}.ksef-table-panel .panel-title .pill{flex:0 0 auto!important;max-width:100%!important;white-space:nowrap!important}.ksef-table-panel .status-form{width:100%!important;min-width:0!important}.ksef-table-panel .payment-status{width:100%!important;min-width:0!important}.ksef-table-panel .status-note{white-space:normal!important;overflow-wrap:anywhere!important}.ksef-table-panel .ksef-details{display:block!important}.ksef-table-panel .ksef-details::before{display:none!important}.ksef-table-panel .ksef-details .link-button{display:inline-flex!important;min-width:104px!important;min-height:38px!important;align-items:center!important;justify-content:center!important;white-space:nowrap!important}.ksef-table-panel .due-amount{font-size:16px!important;white-space:normal!important}.ksef-table-panel .pill{white-space:normal!important}
  .invoice-dialog .invoice-positions .table-wrap{overflow-x:auto!important}.invoice-dialog .invoice-positions table{display:table!important;min-width:520px!important}.invoice-dialog .invoice-positions thead{display:table-header-group!important}.invoice-dialog .invoice-positions tbody{display:table-row-group!important}.invoice-dialog .invoice-positions tr{display:table-row!important;padding:0!important;border:0!important;background:transparent!important}.invoice-dialog .invoice-positions td{display:table-cell!important;width:auto!important;padding:14px 16px!important;border-bottom:1px solid var(--status-line)!important}.invoice-dialog .invoice-positions td::before{display:none!important}
}

/* Must follow the mobile/KSeF compatibility layer above: it is the final
   contrast contract for the invoice action in either theme. */
.ksef-table-panel .ksef-details .link-button,
html[data-theme="dark"] .ksef-table-panel .ksef-details .link-button{
  background:var(--status-surface-alt)!important;
  color:var(--status-text)!important;
  border-color:var(--status-line)!important;
}
.ksef-table-panel .ksef-details .link-button:hover,
.ksef-table-panel .ksef-details .link-button:focus,
html[data-theme="dark"] .ksef-table-panel .ksef-details .link-button:hover,
html[data-theme="dark"] .ksef-table-panel .ksef-details .link-button:focus{
  background:var(--status-brand-soft)!important;
  color:var(--status-text)!important;
}

/* Runtime QA round 6: compact operational views without changing data. */
:root{--status-positive-surface:#153b2d;--status-positive-border:#153b2d;--status-positive-text:#fff;--status-positive-muted:#cfe2d8}
html[data-theme="dark"]{--status-positive-surface:#20382d;--status-positive-border:#3e6550;--status-positive-text:#eef5ef;--status-positive-muted:#c3d2c6}
.ksef-metrics .metric-card.positive{background:var(--status-positive-surface)!important;border-color:var(--status-positive-border)!important;color:var(--status-positive-text)!important}
.ksef-metrics .metric-card.positive>span,.ksef-metrics .metric-card.positive small{color:var(--status-positive-muted)!important}
.ksef-metrics .metric-card.positive strong{color:var(--status-positive-text)!important}

.integration-disclosure{display:block!important;padding:0!important;overflow:hidden}
.integration-disclosure>summary{display:flex;align-items:center;gap:13px;padding:20px 22px;cursor:pointer;list-style:none}
.integration-disclosure>summary::-webkit-details-marker{display:none}
.integration-disclosure>summary::after{content:'⌄';display:grid;place-items:center;flex:0 0 auto;width:28px;height:28px;margin-left:2px;border-radius:50%;background:var(--status-surface-alt);color:var(--status-text);font-weight:800;transition:transform .18s ease}
.integration-disclosure[open]>summary::after{transform:rotate(180deg)}
.integration-summary{display:grid;gap:3px;min-width:0;flex:1 1 auto}.integration-summary strong{color:var(--status-text);font-size:16px}.integration-summary small{color:var(--status-muted);font-size:12px}.integration-disclosure .integration-copy{padding:0 22px 22px}.integration-disclosure .integration-copy>p{margin:0 0 14px}
@media(min-width:801px){.integration-disclosure:not([open]) .integration-copy{display:block}.integration-disclosure:not([open])>summary::after{transform:rotate(180deg)}}

.finance-mobile-details{display:none}.finance-mobile-detail{width:min(440px,calc(100vw - 32px));padding:0;background:var(--status-surface);color:var(--status-text);border-color:var(--status-line)}
.finance-mobile-detail form{padding:22px}.finance-mobile-detail .icon-button{float:right}.finance-mobile-detail h2{padding-right:42px;overflow-wrap:anywhere}.finance-mobile-detail dl{display:grid;grid-template-columns:minmax(0,42%) minmax(0,58%);gap:11px 14px;margin:22px 0 0}.finance-mobile-detail dt{color:var(--status-muted);font-size:12px;font-weight:750}.finance-mobile-detail dd{margin:0;color:var(--status-text);font-weight:700;overflow-wrap:anywhere}
.inventory-product .inventory-sku{display:block;margin-top:4px;color:var(--status-muted);font-size:11px;font-weight:650;letter-spacing:0}

@media(max-width:800px){
  .integration-layout{display:grid;gap:10px}.integration-disclosure>summary{min-height:72px;padding:15px 16px}.integration-disclosure .integration-logo{width:38px;height:38px;flex-basis:38px;font-size:15px}.integration-disclosure>summary .status{font-size:10px;white-space:normal;text-align:right}.integration-disclosure .integration-copy{padding:0 16px 18px}.integration-disclosure .dialog-actions{justify-content:flex-start}.integration-disclosure .dialog-actions .primary-button{width:100%}
  .import-history-panel .inventory-table-wrap{width:100%!important;max-width:100%!important;overflow:visible!important;padding:0!important}.import-history-panel table{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;table-layout:auto!important}.import-history-panel thead{display:none!important}.import-history-panel tbody{display:grid!important;gap:10px!important;width:100%!important}.import-history-panel tbody tr{display:block!important;width:100%!important;min-width:0!important;box-sizing:border-box!important;padding:13px!important;border:1px solid var(--status-line)!important;border-radius:13px!important;background:var(--status-surface)!important}.import-history-panel tbody td{display:grid!important;grid-template-columns:minmax(0,40%) minmax(0,60%)!important;gap:10px!important;width:100%!important;min-width:0!important;box-sizing:border-box!important;padding:6px 0!important;border:0!important;overflow-wrap:anywhere!important;white-space:normal!important}.import-history-panel tbody td::before{content:attr(data-label)!important;display:block!important;color:var(--status-muted)!important;font-size:10px!important;font-weight:800!important;letter-spacing:.07em!important;text-transform:uppercase!important}.import-history-panel tbody td>*{min-width:0!important;max-width:100%!important}.import-history-panel .empty-row::before{display:none!important}
  .finance-transactions table.mobile-card-table tbody tr{padding:14px!important}.finance-transactions table.mobile-card-table tbody td:nth-child(3),.finance-transactions table.mobile-card-table tbody td:nth-child(4),.finance-transactions table.mobile-card-table tbody td:nth-child(6){display:none!important}.finance-transactions table.mobile-card-table tbody td:nth-child(1),.finance-transactions table.mobile-card-table tbody td:nth-child(2),.finance-transactions table.mobile-card-table tbody td:nth-child(5){display:block!important;width:100%!important;padding:4px 0!important}.finance-transactions table.mobile-card-table tbody td:nth-child(1)::before,.finance-transactions table.mobile-card-table tbody td:nth-child(2)::before,.finance-transactions table.mobile-card-table tbody td:nth-child(5)::before{display:none!important}.finance-transactions table.mobile-card-table tbody td:nth-child(1){color:var(--status-muted)!important;font-size:12px!important;font-weight:750!important}.finance-transactions table.mobile-card-table tbody td:nth-child(2){color:var(--status-text)!important;font-size:15px!important;font-weight:800!important;line-height:1.38!important;overflow-wrap:anywhere!important}.finance-transactions table.mobile-card-table tbody td:nth-child(2) .tag{display:inline-flex!important;margin:7px 0 0!important;font-size:10px!important}.finance-transactions .finance-gross{margin-top:9px!important;color:inherit!important;font-size:18px!important;font-weight:850!important}.finance-transactions .finance-mobile-details{display:inline-flex!important;margin:10px 0 0!important;padding:0;border:0;background:transparent;color:var(--status-muted);font:750 12px/1 inherit;text-decoration:underline;cursor:pointer}.finance-transactions .finance-mobile-details:focus-visible{outline:2px solid var(--status-text);outline-offset:3px}
  .inventory-section .inventory-product{align-items:flex-start!important}.inventory-section .inventory-product small{display:block!important;margin-top:4px;color:var(--status-muted)!important;font-size:11px!important;font-weight:650!important}.inventory-section .inventory-compact tbody td:nth-child(2),.inventory-section .inventory-compact tbody td:nth-child(3){grid-template-columns:minmax(0,42%) minmax(0,58%)!important}.inventory-section .inventory-compact tbody td:last-child{margin-top:4px!important}
}

/* Runtime QA round 7: mobile import history is intentionally separate from
   the desktop table, so a filename can never dictate the page width. */
.import-history-mobile{display:none}
:root{--status-income:#176142;--status-expense:#a34938}
html[data-theme="dark"]{--status-income:#7ed4a9;--status-expense:#ff9d90}
@media(max-width:800px){
  .import-history-panel>summary{min-width:0!important}
  .import-history-panel>summary>div{min-width:0!important;flex:1 1 auto!important}
  .import-history-panel>summary .pill{flex:0 0 auto!important;white-space:nowrap!important}
  .import-history-panel>.inventory-table-wrap{display:none!important}
  .import-history-mobile{display:grid!important;gap:10px!important;width:100%!important;max-width:100%!important;min-width:0!important;padding:0 18px 18px!important;box-sizing:border-box!important}
  .import-history-entry{display:grid!important;gap:12px!important;width:100%!important;max-width:100%!important;min-width:0!important;box-sizing:border-box!important;padding:14px!important;border:1px solid var(--status-line)!important;border-radius:14px!important;background:var(--status-surface)!important}
  .import-history-entry>strong{min-width:0!important;color:var(--status-text)!important;font-size:14px!important;line-height:1.4!important;overflow-wrap:anywhere!important;word-break:normal!important}
  .import-history-entry dl{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;margin:0!important}
  .import-history-entry dl>div{display:grid!important;gap:3px!important;min-width:0!important}
  .import-history-entry dt{color:var(--status-muted)!important;font-size:10px!important;font-weight:800!important;letter-spacing:.07em!important;text-transform:uppercase!important}
  .import-history-entry dd{min-width:0!important;margin:0!important;color:var(--status-text)!important;font-size:13px!important;font-weight:700!important;overflow-wrap:anywhere!important}
  .import-history-entry dl>div:last-child{grid-column:1/-1!important}

  .finance-transactions table.mobile-card-table tbody tr{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;column-gap:14px!important;row-gap:4px!important;padding:15px!important}
  .finance-transactions table.mobile-card-table tbody td:nth-child(3),.finance-transactions table.mobile-card-table tbody td:nth-child(4),.finance-transactions table.mobile-card-table tbody td:nth-child(6){display:none!important}
  .finance-transactions table.mobile-card-table tbody td:nth-child(1),.finance-transactions table.mobile-card-table tbody td:nth-child(2),.finance-transactions table.mobile-card-table tbody td:nth-child(5){display:block!important;min-width:0!important;width:auto!important;margin:0!important;padding:0!important}
  .finance-transactions table.mobile-card-table tbody td:nth-child(1)::before,.finance-transactions table.mobile-card-table tbody td:nth-child(2)::before,.finance-transactions table.mobile-card-table tbody td:nth-child(5)::before{display:none!important}
  .finance-transactions table.mobile-card-table tbody td:nth-child(2){grid-column:1!important;grid-row:1!important;color:var(--status-text)!important;font-size:15px!important;font-weight:800!important;line-height:1.38!important;overflow-wrap:anywhere!important}
  .finance-transactions table.mobile-card-table tbody td:nth-child(5){grid-column:2!important;grid-row:1!important;align-self:start!important;text-align:right!important}
  .finance-transactions table.mobile-card-table tbody td:nth-child(1){grid-column:1!important;grid-row:2!important;align-self:center!important;color:var(--status-muted)!important;font-size:12px!important;font-weight:750!important}
  .finance-transactions table.mobile-card-table tbody td:nth-child(2) .tag{display:inline-flex!important;margin:8px 0 0!important;font-size:10px!important}
  .finance-transactions .finance-gross{margin:0!important;font-size:18px!important;font-weight:850!important;white-space:nowrap!important}
  .finance-transactions .finance-gross.income{color:var(--status-income)!important}
  .finance-transactions .finance-gross.expense{color:var(--status-expense)!important}
  .finance-transactions .finance-mobile-details{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-width:104px!important;min-height:38px!important;margin:10px 0 0!important;padding:8px 10px!important;border:1px solid var(--status-line)!important;border-radius:9px!important;background:var(--status-surface-alt)!important;color:var(--status-text)!important;font:800 12px/1 inherit!important;text-decoration:none!important;cursor:pointer!important}
  .finance-transactions .finance-mobile-details:hover,.finance-transactions .finance-mobile-details:active{background:var(--status-brand-soft)!important}
  .finance-transactions .finance-mobile-details:focus-visible{outline:2px solid var(--status-text)!important;outline-offset:3px!important}
}

/* Performance/UI pass: the mobile sheet is a self-contained surface, not a
   desktop dialog with square lower corners. */
.trend-values-list{display:none}
@media(max-width:800px){
  .mobile-more-sheet{border-radius:24px!important;overflow:hidden!important}
  .mobile-more-sheet .sheet-close{display:grid!important;place-items:center!important;width:40px!important;height:40px!important;min-width:40px!important;padding:0!important;line-height:1!important}
  .mobile-more-sheet .sheet-launcher svg{display:block!important;width:19px!important;height:19px!important;flex:0 0 19px!important;color:var(--status-text)!important}

  /* 3 months fit their value labels above the bars. For denser ranges the
     chart retains the visual trend and an adjacent semantic list keeps every
     monthly value readable without overlap. */
  .trend-range-6 .trend-value,.trend-range-12 .trend-value{visibility:hidden!important}
  .trend-range-12{gap:3px!important}
  .trend-range-12 .trend-column{grid-template-rows:0 1fr 22px!important;gap:5px!important}
  .trend-range-12 .trend-track i{width:100%!important;max-width:14px!important}
  .trend-range-12 .trend-column small{font-size:9px!important;letter-spacing:-.03em!important}
  .trend-values-list{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;margin:16px 0 0!important;padding:0!important;list-style:none!important}
  .trend-values-list li{display:flex!important;align-items:baseline!important;justify-content:space-between!important;gap:8px!important;min-width:0!important;padding:9px 10px!important;border:1px solid var(--status-line)!important;border-radius:10px!important;background:var(--status-surface-alt)!important}
  .trend-values-list span{min-width:0!important;color:var(--status-muted)!important;font-size:12px!important;font-weight:750!important}
  .trend-values-list strong{min-width:0!important;text-align:right!important;font-size:12px!important;white-space:nowrap!important}
}
.source-freshness-control{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-left:auto;color:var(--status-muted);font-size:.78rem;font-weight:700}.source-freshness-control span{min-width:0}.source-freshness-control form{margin:0}.integration-data-status{margin:18px 0 0}.integration-data-status .eyebrow{margin:0 0 7px}.integration-status-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 0;border-bottom:1px solid var(--status-line);color:var(--status-muted);font-size:.84rem}.integration-status-row strong{color:var(--status-text);font-size:.84rem;text-align:right}.integration-refresh-action{justify-content:flex-end;margin-top:14px}.integration-refresh-action form{margin:0}@media(max-width:800px){.scope-heading .source-freshness-control{width:100%;order:3;margin-left:0;align-items:flex-start}.integration-status-row{align-items:flex-start}.integration-status-row strong{max-width:62%}}
.details-action,.secondary-action{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:8px 10px;border:1px solid var(--status-line);border-radius:9px;background:var(--status-surface-alt);color:var(--status-text);font:inherit;font-size:12px;font-weight:800;line-height:1;text-decoration:none;cursor:pointer}.details-action:hover,.details-action:focus,.secondary-action:hover,.secondary-action:focus{background:var(--status-brand-soft);color:var(--status-text);border-color:var(--status-line);outline:2px solid var(--status-text);outline-offset:2px}.details-action:disabled,.secondary-action:disabled{opacity:.48;cursor:not-allowed;outline:0}.ksef-table-panel .ksef-details .details-action{background:var(--status-surface-alt)!important;color:var(--status-text)!important;border-color:var(--status-line)!important}.ksef-table-panel .ksef-details .details-action:hover,.ksef-table-panel .ksef-details .details-action:focus{background:var(--status-brand-soft)!important;color:var(--status-text)!important;border-color:var(--status-line)!important}
@media(max-width:800px){.details-action{min-width:104px;min-height:38px}}
