:root{
  --bg:#f3f6f8;--surface:#fff;--surface-2:#f8fafb;--ink:#182126;--muted:#6f7d86;--line:#dce4e8;
  --sidebar:#242728;--sidebar-2:#1c1f20;--blue:#08b4ef;--blue-2:#009bd4;--blue-soft:#e8f8fe;
  --green:#1d9b67;--green-soft:#e9f8f1;--red:#d84c4c;--red-soft:#fff0f0;--orange:#e99025;--orange-soft:#fff4e5;
  --purple:#7758d5;--purple-soft:#f0ecff;--over:#3078d8;--shadow:0 10px 35px rgba(23,39,49,.07);--radius:16px;
  --sidebar-w:260px;
}
*{box-sizing:border-box}html{font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;color:var(--ink);background:var(--bg)}
body{margin:0;background:var(--bg);min-height:100vh}a{color:inherit;text-decoration:none}button,input,select,textarea{font:inherit}button{cursor:pointer}img{max-width:100%}
.app-shell{min-height:100vh}.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar-w);background:linear-gradient(180deg,var(--sidebar),var(--sidebar-2));color:#fff;padding:20px 15px;display:flex;flex-direction:column;z-index:40;box-shadow:8px 0 30px rgba(0,0,0,.08)}
.brand{display:block;padding:4px 8px 20px;border-bottom:1px solid rgba(255,255,255,.09);margin-bottom:14px}.brand img{display:block;width:210px;height:auto}.brand>span{display:block;color:var(--blue);font-weight:900;letter-spacing:.34em;font-size:11px;margin:5px 0 0 4px}
.sidebar nav{display:flex;flex-direction:column;gap:3px;overflow:auto;padding:2px 0}.sidebar nav a{display:flex;align-items:center;gap:11px;border-radius:11px;padding:10px 11px;color:#c8d0d4;font-size:14px;font-weight:650;transition:.16s}.sidebar nav a:hover{background:rgba(255,255,255,.055);color:#fff}.sidebar nav a.active{background:rgba(8,180,239,.14);color:#fff;box-shadow:inset 3px 0 var(--blue)}.sidebar nav a.disabled{opacity:.35;pointer-events:none}.sidebar nav a small{margin-left:auto;background:rgba(255,255,255,.08);padding:2px 5px;border-radius:4px;font-size:9px}.nav-icon{width:26px;height:26px;border-radius:8px;display:grid;place-items:center;background:rgba(255,255,255,.06);font-weight:900;color:#dfe7ea}.active .nav-icon{background:var(--blue);color:#04232e}.side-bottom{margin-top:auto;padding-top:15px;border-top:1px solid rgba(255,255,255,.09)}.user-chip{display:flex;gap:10px;align-items:center;padding:7px}.user-chip>span{width:35px;height:35px;border-radius:50%;background:var(--blue);color:#073344;display:grid;place-items:center;font-weight:900}.user-chip b,.user-chip small{display:block}.user-chip b{font-size:13px}.user-chip small{font-size:11px;color:#87949b;margin-top:2px}.logout{display:block;color:#9ca8ad;font-size:12px;padding:8px;margin-top:5px}.logout:hover{color:#fff}
.main{margin-left:var(--sidebar-w);min-width:0}.topbar{height:78px;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border-bottom:1px solid var(--line);display:flex;align-items:center;padding:0 28px;gap:16px;position:sticky;top:0;z-index:30}.topbar h1{font-size:21px;margin:0;font-weight:800;letter-spacing:-.02em}.topbar p{margin:3px 0 0;font-size:12px;color:var(--muted)}.top-status{margin-left:auto;color:var(--muted);font-size:12px;display:flex;align-items:center;gap:7px}.dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#2bc47f;box-shadow:0 0 0 4px rgba(43,196,127,.12)}.menu-toggle{display:none;border:0;background:transparent;font-size:22px;padding:6px}.content{padding:24px 28px 45px;max-width:1680px;margin:0 auto}
.card{background:var(--surface);border:1px solid #e4eaed;border-radius:var(--radius);box-shadow:var(--shadow);padding:20px;margin-bottom:18px}.card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;margin-bottom:17px}.card-head h2{margin:0 0 4px;font-size:17px;letter-spacing:-.015em}.card-head p{margin:0;color:var(--muted);font-size:12.5px;line-height:1.45}.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:18px}.dashboard-grid{align-items:stretch}.dashboard-grid>.card{margin-bottom:18px}.kpi-grid{display:grid;gap:14px;margin-bottom:18px}.kpi-grid.five{grid-template-columns:repeat(5,minmax(0,1fr))}.kpi-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}.kpi{background:#fff;border:1px solid #e3e9ec;border-radius:14px;padding:15px 16px;min-height:91px;display:flex;flex-direction:column;justify-content:center;box-shadow:0 6px 20px rgba(24,35,42,.04);position:relative;overflow:hidden}.kpi:before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:#bcc9cf}.kpi>span{font-size:11px;color:var(--muted);font-weight:700;text-transform:uppercase;letter-spacing:.045em}.kpi>strong{font-size:22px;margin-top:6px;white-space:nowrap}.kpi>small{color:var(--muted);font-size:10.5px;margin-top:3px}.kpi.blue:before{background:var(--blue)}.kpi.ok:before{background:var(--green)}.kpi.bad:before{background:var(--red)}.kpi.orange:before{background:var(--orange)}.kpi.purple:before{background:var(--purple)}.kpi.over:before{background:var(--over)}a.kpi:hover{transform:translateY(-1px);border-color:#cbd9df}
.availability-card{background:linear-gradient(115deg,#172328,#22343b);color:#fff;border-radius:18px;padding:23px 25px;margin-bottom:18px;display:flex;align-items:center;justify-content:space-between;box-shadow:var(--shadow);position:relative;overflow:hidden}.availability-card:after{content:"";position:absolute;right:16%;top:-80px;width:220px;height:220px;background:radial-gradient(circle,rgba(8,180,239,.23),transparent 68%)}.availability-card small,.availability-card p{display:block;color:#afbdc3}.availability-card strong{display:block;font-size:32px;margin-top:4px}.availability-card p{font-size:12px;margin:5px 0 0}.availability-card .btn{z-index:1}
.quick-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.quick-grid a{border:1px solid var(--line);background:var(--surface-2);padding:14px;border-radius:12px;display:flex;align-items:center;gap:11px;font-size:12.5px;font-weight:700}.quick-grid a:hover{border-color:#b8dbe8;background:var(--blue-soft)}.quick-grid b{width:30px;height:30px;border-radius:9px;background:var(--blue-soft);color:var(--blue-2);display:grid;place-items:center;font-size:15px}
.period-nav{display:flex;align-items:center;gap:8px;background:#fff;border:1px solid var(--line);padding:7px;border-radius:13px;width:max-content;margin:0 0 16px}.period-nav>div{min-width:150px;text-align:center}.period-nav small,.period-nav strong{display:block}.period-nav small{color:var(--muted);font-size:9px;text-transform:uppercase;letter-spacing:.07em}.period-nav strong{font-size:13px;margin-top:1px}.period-nav input,.period-nav select{border:0;background:var(--surface-2);border-radius:8px;padding:7px;font-size:12px;color:var(--muted)}.icon-btn{width:34px;height:34px;border:1px solid var(--line);border-radius:9px;display:grid;place-items:center;font-size:23px;color:#52646e}.icon-btn:hover{background:var(--blue-soft);border-color:#aedaeb}.tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin-bottom:18px;padding-left:4px}.tabs a{padding:11px 15px;font-size:13px;color:var(--muted);font-weight:700;border-bottom:2px solid transparent;margin-bottom:-1px}.tabs a.active{color:var(--blue-2);border-color:var(--blue)}
.btn{border:1px solid #cfdadd;background:#fff;color:#354750;border-radius:9px;padding:8px 12px;font-size:12px;font-weight:750;line-height:1.2;transition:.15s;white-space:nowrap}.btn:hover{border-color:#9eb4bd;background:#f8fbfc}.btn.primary{background:var(--blue);border-color:var(--blue);color:#062f3f;box-shadow:0 5px 16px rgba(8,180,239,.18)}.btn.primary:hover{background:#19bef6}.btn.danger{color:#b73e3e;border-color:#f0c5c5;background:#fff8f8}.btn.small{font-size:10.5px;padding:6px 8px}.btn.large{padding:11px 17px;font-size:13px}.btn:disabled{opacity:.5;cursor:not-allowed}.actions{display:flex;gap:5px;justify-content:flex-end;white-space:nowrap}
.table-wrap{overflow:auto;width:100%}table{border-collapse:separate;border-spacing:0;width:100%;font-size:12px}th{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:#78868e;background:#f7f9fa;font-weight:800;padding:10px;border-top:1px solid #e5eaed;border-bottom:1px solid #e5eaed;text-align:left;white-space:nowrap}th:first-child{border-left:1px solid #e5eaed;border-radius:8px 0 0 0}th:last-child{border-right:1px solid #e5eaed;border-radius:0 8px 0 0}td{padding:10px;border-bottom:1px solid #edf1f3;vertical-align:middle}tbody tr:hover td{background:#fbfdfe}.right{text-align:right}.check{width:38px}.block{display:block}.muted-row{opacity:.57}.muted-row:hover{opacity:.8}.table-tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.table-tools input[type=search]{min-width:240px}.table-tools select{width:auto}.bulk-bar{display:flex;gap:9px;align-items:center;flex-wrap:wrap;background:#f7fafb;border:1px solid var(--line);border-radius:11px;padding:9px 11px;margin-bottom:11px;font-size:11.5px;color:#60717a}.bulk-bar>span{margin-left:auto;color:#87969d}.bulk-bar select,.bulk-bar input{width:auto;min-width:130px}.pagination{display:flex;justify-content:flex-end;align-items:center;gap:5px;padding-top:12px}.pagination button{border:1px solid var(--line);background:#fff;border-radius:7px;min-width:30px;height:29px;font-size:11px}.pagination button.active{background:var(--blue);border-color:var(--blue);font-weight:800}.pagination span{font-size:11px;color:var(--muted);margin-right:5px}
input,select,textarea{border:1px solid #ccd7dc;border-radius:9px;background:#fff;color:var(--ink);padding:9px 10px;outline:none;transition:.15s;width:100%}input:focus,select:focus,textarea:focus{border-color:#6bcdf1;box-shadow:0 0 0 3px rgba(8,180,239,.1)}textarea{resize:vertical;min-height:85px}label{font-size:11.5px;font-weight:700;color:#53656e;display:flex;flex-direction:column;gap:5px}.inline-select{min-width:70px;padding:6px}.percent-input{display:flex;align-items:center;gap:4px}.percent-input input{width:78px;padding:6px}.percent-input span{color:var(--muted)}.toolbar-form{display:flex;align-items:flex-end;gap:10px;flex-wrap:wrap}.toolbar-form label{width:160px}.form-hint{font-size:11px;color:var(--muted);padding-bottom:9px}.form-grid{display:grid;gap:13px}.form-grid.two{grid-template-columns:1fr 1fr}.form-grid .wide{grid-column:1/-1}.settings-layout{max-width:1050px}.settings-save{position:sticky;bottom:14px;display:flex;justify-content:flex-end;padding:9px 0}.switch-list{display:grid;gap:9px;margin-top:15px}.switch-list label{display:flex;flex-direction:row;align-items:flex-start;border:1px solid var(--line);border-radius:11px;padding:11px;background:#fafcfd}.switch-list input{width:auto;margin-top:3px}.switch-list b,.switch-list small{display:block}.switch-list small{font-weight:400;color:var(--muted);margin-top:2px;line-height:1.35}
.badge{display:inline-flex;align-items:center;border-radius:20px;padding:3px 7px;font-size:9.5px;font-weight:800;background:#eef2f4;color:#61717a;white-space:nowrap}.badge.blue{background:var(--blue-soft);color:#087ea7}.badge.ok,.badge.sale{background:var(--green-soft);color:#188058}.badge.warn{background:var(--orange-soft);color:#aa681a}.badge.zus{background:var(--purple-soft);color:#654bb7}.badge.pit{background:var(--orange-soft);color:#b56b12}.badge.vat{background:var(--blue-soft);color:#087ea7}.diff{font-size:10.5px;font-weight:800;white-space:nowrap;padding:4px 7px;border-radius:7px}.diff.ok{background:var(--green-soft);color:var(--green)}.diff.bad{background:var(--red-soft);color:var(--red)}.diff.over{background:#eaf2ff;color:var(--over)}
.importer-hero{background:linear-gradient(115deg,#fff,#effaff);display:flex;justify-content:space-between;align-items:center}.importer-hero h2{margin:3px 0 6px;font-size:21px}.importer-hero p{margin:0;color:var(--muted);font-size:12.5px;max-width:720px}.eyebrow{font-size:10px;text-transform:uppercase;letter-spacing:.12em;font-weight:900;color:var(--blue-2)}.ksef-state{min-width:120px;border-left:1px solid #cde6ef;padding-left:18px}.ksef-state b,.ksef-state small{display:block}.ksef-state b{font-size:12px;margin:4px 0}.ksef-state small{color:var(--muted);font-size:10px}
.chart{display:block;width:100%;height:270px}.chart.single{height:250px}.summary-table{font-size:13px}.summary-table th{background:transparent;border:0;text-transform:none;font-size:12px;padding:13px 5px}.summary-table td{text-align:right;font-size:15px;font-weight:700}.summary-table .strong th,.summary-table .strong td{border-top:2px solid var(--line);font-size:16px}.info-box,.warning-box{background:#f0f9fd;border:1px solid #cfeaf5;color:#4a6672;border-radius:11px;padding:11px 13px;font-size:11.5px;line-height:1.45;margin-top:12px}.warning-box{background:#fff9ee;border-color:#f1dfb9;color:#765b31}.disabled-module{text-align:center;padding:50px 20px}.disabled-module>b{font-size:22px}.disabled-module p{color:var(--muted);max-width:560px;margin:8px auto 18px}.empty{text-align:center;color:var(--muted);padding:35px 10px}.empty span{font-size:25px;opacity:.45}.empty p{font-size:12px}.alert{border-radius:9px;padding:10px 12px;font-size:12px;margin-bottom:12px}.alert.bad{background:var(--red-soft);color:#a43a3a;border:1px solid #f0caca}
.modal-backdrop{position:fixed;inset:0;background:rgba(9,17,20,.61);z-index:100;display:grid;place-items:center;padding:24px;backdrop-filter:blur(3px)}.modal-backdrop[hidden]{display:none}.modal-card{background:#fff;border-radius:17px;box-shadow:0 24px 80px rgba(0,0,0,.28);width:min(980px,96vw);max-height:91vh;overflow:auto;padding:24px;position:relative}.modal-card.narrow{width:min(620px,96vw)}.modal-close{position:absolute;right:13px;top:12px;border:0;background:#edf2f4;border-radius:50%;width:31px;height:31px;font-size:20px;color:#58676e;z-index:3}.modal-title{font-size:20px;margin:0 45px 5px 0}.modal-sub{color:var(--muted);font-size:12px;margin:0 0 18px}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:16px}.invoice-preview{padding-top:9px}.preview-head{display:grid;grid-template-columns:2fr 1fr 1fr;gap:12px;border-bottom:1px solid var(--line);padding-bottom:14px;margin-bottom:14px}.preview-head span,.preview-parties small{display:block;color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.05em}.preview-head strong{display:block;font-size:15px;margin-top:3px}.preview-parties{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:18px}.preview-parties>div{background:#f8fafb;border:1px solid var(--line);border-radius:11px;padding:12px}.preview-parties b,.preview-parties span{display:block}.preview-parties b{margin:5px 0;font-size:13px}.preview-parties span{font-size:11px;color:var(--muted)}.compact td,.compact th{padding:7px}
.toast-stack{position:fixed;right:20px;bottom:20px;z-index:150;display:flex;flex-direction:column;gap:8px;max-width:390px}.toast{background:#202c31;color:#fff;padding:11px 14px;border-radius:10px;box-shadow:0 10px 30px rgba(0,0,0,.2);font-size:12px;animation:toastin .2s ease}.toast.ok{border-left:4px solid #2bc47f}.toast.bad{border-left:4px solid #e85b5b}@keyframes toastin{from{transform:translateY(10px);opacity:0}to{transform:none;opacity:1}}
.login-body{min-height:100vh;display:grid;place-items:center;background:radial-gradient(circle at 25% 20%,#26383f,#171b1d 55%,#111416);padding:20px}.login-card{background:#fff;border-radius:20px;padding:30px;width:min(420px,95vw);box-shadow:0 30px 90px rgba(0,0,0,.35)}.login-card img{display:block;width:280px;background:#292b2b;border-radius:12px;padding:8px 10px;margin-bottom:4px}.login-product{font-size:10px;font-weight:900;letter-spacing:.32em;color:var(--blue-2)}.login-card h1{margin:24px 0 3px;font-size:24px}.login-card>p{margin:0 0 19px;color:var(--muted);font-size:12px}.login-card form{display:grid;gap:12px}.login-card .btn{margin-top:3px}
.install-body{min-height:100vh;background:#eef3f5;padding:35px 15px}.install-wrap{max-width:880px;margin:auto}.install-head{background:#252828;border-radius:18px 18px 0 0;padding:22px 26px;color:#fff}.install-head img{width:300px;display:block}.install-head h1{font-size:18px;margin:14px 0 4px}.install-head p{font-size:12px;color:#b7c1c5;margin:0}.install-panel{background:#fff;padding:26px;border-radius:0 0 18px 18px;box-shadow:var(--shadow)}.install-panel .form-grid{margin-bottom:18px}.install-note{font-size:11.5px;color:var(--muted);line-height:1.5}
@media(max-width:1180px){.kpi-grid.five{grid-template-columns:repeat(3,1fr)}.sidebar{width:230px}.main{margin-left:230px}.grid-2{grid-template-columns:1fr}.content{padding:20px}.table-tools input[type=search]{min-width:190px}}
@media(max-width:820px){.sidebar{transform:translateX(-102%);transition:.2s;width:260px}.sidebar.open{transform:none}.main{margin-left:0}.menu-toggle{display:block}.topbar{padding:0 15px;height:68px}.content{padding:15px}.kpi-grid.five,.kpi-grid.three{grid-template-columns:1fr 1fr}.availability-card{align-items:flex-start;gap:18px}.card-head{flex-direction:column}.table-tools{width:100%}.table-tools input[type=search]{width:100%}.form-grid.two{grid-template-columns:1fr}.form-grid .wide{grid-column:auto}.importer-hero{align-items:flex-start;gap:20px}.preview-head{grid-template-columns:1fr 1fr}.preview-parties{grid-template-columns:1fr}.toolbar-form label{width:calc(50% - 6px)}.toolbar-form .form-hint{width:100%}.quick-grid{grid-template-columns:1fr 1fr}}
@media(max-width:530px){.kpi-grid.five,.kpi-grid.three{grid-template-columns:1fr}.availability-card{flex-direction:column}.availability-card strong{font-size:27px}.quick-grid{grid-template-columns:1fr}.period-nav{width:100%;justify-content:space-between}.period-nav>div{min-width:110px}.period-nav input,.period-nav select{display:none}.card{padding:15px}.modal-backdrop{padding:8px}.modal-card{padding:18px 14px}.preview-head{grid-template-columns:1fr}.toolbar-form label{width:100%}.bulk-bar>*{width:100%}.bulk-bar input,.bulk-bar select{width:100%}.bulk-bar>span{margin-left:0}.brand img{width:200px}}

/* === Visual audit fixes 1.0.1 === */
.main,.content,.card,.card-head>*,.grid-2>*{min-width:0}
.content{width:100%}
.card-head>div:first-child{flex:1 1 320px;min-width:0}
.card-head .table-tools{flex:0 1 auto;justify-content:flex-end;max-width:100%}
.card-head .table-tools input[type=search]{width:min(360px,38vw);min-width:220px}
.kpi>strong{font-variant-numeric:tabular-nums;line-height:1.1;max-width:100%;overflow:hidden;text-overflow:ellipsis;font-size:clamp(18px,1.65vw,22px)}
.period-nav input,.period-nav select{width:auto;min-width:130px}
.tabs{overflow-x:auto;overflow-y:hidden;scrollbar-width:none}.tabs::-webkit-scrollbar{display:none}.tabs a{white-space:nowrap;flex:0 0 auto}
.table-wrap{max-width:100%;overflow-x:auto;overflow-y:hidden;overscroll-behavior-inline:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:#b7c7ce #eef3f5;padding-bottom:2px}
.table-wrap::-webkit-scrollbar{height:10px}.table-wrap::-webkit-scrollbar-track{background:#eef3f5;border-radius:10px}.table-wrap::-webkit-scrollbar-thumb{background:#b7c7ce;border-radius:10px;border:2px solid #eef3f5}.table-wrap::-webkit-scrollbar-thumb:hover{background:#92a8b1}
.table-wrap>table{min-width:820px}
#ksefTable{min-width:1180px}#costTable{min-width:1110px}#salesTable{min-width:1000px}#zusTable,#pitTable{min-width:980px}#paymentsTable{min-width:860px}#summaryTable{min-width:1080px}#vatTable{min-width:820px}#auditTable{min-width:980px}
th,td{line-height:1.35}td{overflow-wrap:normal;word-break:normal}.right{white-space:nowrap;font-variant-numeric:tabular-nums}.check{min-width:42px;width:42px}
td.actions{display:table-cell;white-space:nowrap;text-align:right;vertical-align:middle}td.actions .btn+ .btn{margin-left:4px}
#ksefTable th:last-child,#ksefTable td:last-child,#costTable th:last-child,#costTable td:last-child,#salesTable th:last-child,#salesTable td:last-child,#zusTable th:last-child,#zusTable td:last-child,#pitTable th:last-child,#pitTable td:last-child{position:sticky;right:0;z-index:2;background:#fff;box-shadow:-8px 0 14px -14px rgba(20,39,48,.55)}
#ksefTable thead th:last-child,#costTable thead th:last-child,#salesTable thead th:last-child,#zusTable thead th:last-child,#pitTable thead th:last-child{z-index:4;background:#f7f9fa}
#ksefTable tbody tr:hover td:last-child,#costTable tbody tr:hover td:last-child,#salesTable tbody tr:hover td:last-child,#zusTable tbody tr:hover td:last-child,#pitTable tbody tr:hover td:last-child{background:#fbfdfe}
#zusTable th:first-child,#zusTable td:first-child,#pitTable th:first-child,#pitTable td:first-child,#summaryTable th:first-child,#summaryTable td:first-child{position:sticky;left:0;z-index:2;background:#fff;box-shadow:8px 0 14px -14px rgba(20,39,48,.5)}
#zusTable thead th:first-child,#pitTable thead th:first-child,#summaryTable thead th:first-child{z-index:4;background:#f7f9fa}
#zusTable tbody tr:hover td:first-child,#pitTable tbody tr:hover td:first-child,#summaryTable tbody tr:hover td:first-child{background:#fbfdfe}
.register-table td{padding-top:9px;padding-bottom:9px}.register-table .period-cell{min-width:108px;white-space:nowrap}.register-table .doc-cell{min-width:150px}.register-table .doc-cell>.badge{margin-top:5px}.register-table .actions{min-width:148px}
.compare-cell{display:grid;grid-template-columns:minmax(74px,1fr) minmax(74px,1fr) auto;gap:7px;align-items:center;min-width:250px}.compare-cell>div{min-width:0}.compare-cell small{display:block;color:var(--muted);font-size:8.5px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;margin-bottom:3px}.compare-cell b{display:block;font-size:11.5px;white-space:nowrap;font-variant-numeric:tabular-nums}.compare-cell .diff{display:inline-flex}.compare-empty{color:var(--muted);font-weight:700}
.payment-cell{min-width:180px}.payment-total{display:flex;align-items:baseline;gap:7px;white-space:nowrap}.payment-total b{font-size:12.5px;font-variant-numeric:tabular-nums}.payment-total small{color:var(--muted)}.payment-dates{display:block;color:var(--muted);font-size:9.5px;margin:3px 0 6px;white-space:normal;max-width:190px}.payment-cell .diff{display:inline-flex}
#auditTable td:nth-child(5){max-width:520px;overflow-wrap:anywhere;word-break:break-word}#paymentsTable td:nth-child(5){max-width:360px;overflow-wrap:anywhere}
.pagination{flex-wrap:wrap;row-gap:7px}.pagination span{font-variant-numeric:tabular-nums}
.invoice-preview .table-wrap>table{min-width:640px}
@media(max-width:1180px){.card-head .table-tools input[type=search]{width:min(320px,34vw)}#summaryTable{min-width:1040px}}
@media(max-width:820px){.card-head .table-tools{justify-content:stretch}.card-head .table-tools input[type=search]{width:100%;min-width:0}.table-wrap{width:calc(100% + 40px);max-width:none;margin-left:-20px;padding-left:20px;padding-right:20px}.register-table .actions{min-width:138px}.compare-cell{min-width:235px}.kpi>strong{font-size:22px}}
@media(max-width:530px){.table-wrap{width:calc(100% + 30px);margin-left:-15px;padding-left:15px;padding-right:15px}.table-wrap>table{min-width:760px}#zusTable,#pitTable{min-width:900px}#ksefTable{min-width:1080px}#costTable{min-width:1040px}#salesTable{min-width:940px}#summaryTable{min-width:1000px}.pagination{justify-content:flex-start}.pagination span{width:100%;margin-right:0}.kpi>strong{font-size:22px}}

/* Visual audit pass 2: mobile/card flow + predictable wide tables */
#ksefTable th:last-child,#ksefTable td:last-child,#costTable th:last-child,#costTable td:last-child,#salesTable th:last-child,#salesTable td:last-child,#zusTable th:last-child,#zusTable td:last-child,#pitTable th:last-child,#pitTable td:last-child{position:static;right:auto;z-index:auto;box-shadow:none}
#ksefTable thead th:last-child,#costTable thead th:last-child,#salesTable thead th:last-child,#zusTable thead th:last-child,#pitTable thead th:last-child{background:#f7f9fa}
#ksefTable tbody tr:hover td:last-child,#costTable tbody tr:hover td:last-child,#salesTable tbody tr:hover td:last-child,#zusTable tbody tr:hover td:last-child,#pitTable tbody tr:hover td:last-child{background:#fbfdfe}
#zusTable,#pitTable{min-width:940px}#summaryTable{min-width:980px}#costTable{min-width:1060px}
.register-table .period-cell{min-width:95px}.register-table .doc-cell{min-width:115px}.register-table .actions{min-width:120px}
.compare-cell{grid-template-columns:minmax(52px,1fr) minmax(52px,1fr) auto;gap:5px;min-width:190px}.compare-cell b{font-size:11px}.payment-cell{min-width:135px}.payment-dates{max-width:150px}
#costTable td.actions{min-width:150px;white-space:normal}#costTable td.actions .btn{margin:2px 0 2px 3px}
@media(max-width:820px){.card-head>div:first-child{flex:0 0 auto;width:100%}.card-head .table-tools{flex:0 0 auto;width:100%}}
@media(max-width:530px){#zusTable,#pitTable{min-width:940px}#summaryTable{min-width:980px}}
/* Final visual tightening */
#costTable{min-width:1000px}#costTable td:nth-child(3){max-width:205px}#costTable td:nth-child(3) small{display:block;max-width:190px;overflow-wrap:anywhere;word-break:break-word}
.topbar>div{min-width:0}.topbar h1,.topbar p{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:530px){.importer-hero{flex-direction:column}.ksef-state{width:100%;min-width:0;border-left:0;border-top:1px solid #cde6ef;padding-left:0;padding-top:12px}.toast-stack{left:12px;right:12px;bottom:12px;max-width:none}.toast{width:100%}}

/* === UX / scope / totals 1.0.2 === */
.scope-row{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 10px;min-width:0}.scope-switch{display:inline-flex;align-items:center;background:#fff;border:1px solid var(--line);border-radius:12px;padding:4px;box-shadow:0 4px 16px rgba(24,35,42,.03)}.scope-switch a{padding:8px 14px;border-radius:9px;font-size:12px;font-weight:800;color:var(--muted);white-space:nowrap}.scope-switch a:hover{color:var(--ink);background:#f4f8fa}.scope-switch a.active{background:var(--blue);color:#062f3f;box-shadow:0 4px 12px rgba(8,180,239,.18)}.scope-current{text-align:right;min-width:0}.scope-current small,.scope-current b{display:block}.scope-current small{color:var(--muted);font-size:9px;text-transform:uppercase;letter-spacing:.07em}.scope-current b{font-size:12px;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
tfoot th,tfoot td{background:#eef5f8!important;border-top:2px solid #c8d8df!important;border-bottom:1px solid #d9e4e8;font-weight:850;color:#31454f}tfoot th:first-child{border-left:1px solid #d9e4e8}tfoot th:last-child,tfoot td:last-child{border-right:1px solid #d9e4e8}.inactive-row td{background:#f7f8f9!important;color:#8c989e}.inactive-row b{color:#6f7d86}.inactive-row:hover td{background:#f2f5f6!important}
.sync-status{margin-top:12px;border:1px solid #bfe1ec;background:#f1fbff;color:#315d6b;border-radius:10px;padding:10px 12px;font-size:11.5px;line-height:1.45}.sync-status.working{border-color:#bfe1ec;background:#f1fbff}.sync-status.ok{border-color:#bfe9d6;background:#effaf5;color:#286849}.sync-status.warn{border-color:#f1d29f;background:#fff8eb;color:#805a22}.sync-status.bad{border-color:#f1c4c4;background:#fff3f3;color:#8f3838}.dra-live{border:1px dashed #bbdce8;background:#f5fbfd;border-radius:9px;padding:9px 11px;color:#51717d;font-size:11px;font-weight:650;min-height:36px;display:flex;align-items:center}.toolbar-form .btn{align-self:flex-end}
.brand img,.login-card img,.install-head img{object-fit:contain;object-position:left center}
@media(max-width:820px){.scope-row{align-items:stretch;flex-direction:column}.scope-switch{width:100%;display:grid;grid-template-columns:repeat(3,1fr)}.scope-switch a{text-align:center;padding:9px 7px}.scope-current{text-align:left}.scope-current b{white-space:normal}.toolbar-form>.btn{flex:1 1 auto}}
@media(max-width:530px){.scope-switch a{font-size:11px}.toolbar-form>.btn{width:100%}}
/* 1.0.8 — PIT: automatyczna zaliczka i kwota pozostała do wpłaty */
.pit-remaining{font-size:15px;color:var(--orange);white-space:nowrap}
.inactive-row .pit-remaining{color:var(--muted)}
