:root{
  --navy:#10253b;
  --navy-dark:#08192b;
  --border:#d7d7d7;
  --text:#111;
  --muted:#6c6c6c;
  --bg:#fafafa;
  --shadow:0 8px 22px rgba(0,0,0,.08);
}
*{box-sizing:border-box}
body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;background:var(--bg);color:var(--text)}
a{text-decoration:none;color:inherit}
.login-page{background:#fff;min-height:100vh}
.login-wrapper{min-height:100vh;display:flex;align-items:flex-start;justify-content:center;padding:105px 26px 30px}
.login-card{width:100%;max-width:430px;text-align:center}
.brand-login{margin:0 auto 72px}
.login-logo{display:block;width:min(100%,520px);max-width:520px;margin:0 auto}
.brand-script{font-family:"Times New Roman",serif;font-style:italic;font-size:56px;line-height:.95;letter-spacing:.5px}
.brand-script.large{font-size:64px}
.brand-subtitle{font-family:Georgia,serif;color:#9b9b9b;font-size:34px;letter-spacing:1px;margin-top:8px}
.login-card h1{font-size:30px;font-weight:700;margin:0 0 26px}
.login-form{display:grid;gap:18px}
input{width:100%;height:54px;border:1px solid #c9c9c9;border-radius:8px;padding:0 18px;font-size:18px;outline:none;background:#fff}
input:focus{border-color:var(--navy);box-shadow:0 0 0 3px rgba(16,37,59,.1)}
.input-box{position:relative}.input-box input{padding-left:58px}.input-icon{position:absolute;left:18px;top:50%;transform:translateY(-50%);font-size:18px;opacity:.62;z-index:1}.password-box{position:relative}
.password-box input{padding-right:60px}
.password-box button{position:absolute;right:15px;top:50%;transform:translateY(-50%);border:0;background:transparent;font-size:20px;cursor:pointer;opacity:.65}
.primary-btn,.module-card span{background:var(--navy);color:#fff;border:0;border-radius:8px;height:54px;font-size:20px;font-weight:600;box-shadow:0 5px 12px rgba(0,0,0,.22);cursor:pointer;display:flex;align-items:center;justify-content:center}
.alert{padding:14px;border-radius:10px;margin-bottom:18px;font-weight:600}.alert-error{background:#ffe8e8;color:#8b0000}.login-hint{margin-top:18px;color:#999;font-size:14px}
.topbar{height:78px;background:linear-gradient(90deg,var(--navy-dark),var(--navy));color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 34px;box-shadow:0 2px 10px rgba(0,0,0,.2)}
.top-left{display:flex;align-items:center;gap:22px}.menu-icon{font-size:26px}.brand-small{font-family:Georgia,serif;text-align:center;line-height:1}.brand-small span{display:block;font-style:italic;font-size:25px}.brand-small small{color:#ccc;font-size:17px}.logout,.back{font-size:18px;font-weight:600}
.container{max-width:1180px;margin:0 auto;padding:110px 34px 40px}.container.narrow{max-width:850px}
.hero-brand{text-align:center;margin-bottom:80px}.welcome{text-align:center;margin-bottom:55px}.welcome h1{font-size:30px;margin:0 0 14px}.welcome p{font-size:19px;color:var(--muted);margin:0}
.modules-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:26px;margin-bottom:38px}.module-card{background:#fff;border:1px solid var(--border);border-radius:12px;padding:48px 24px 36px;text-align:center;box-shadow:var(--shadow);transition:.15s}.module-card:hover{transform:translateY(-2px)}.module-icon{height:70px;font-size:47px;display:flex;align-items:center;justify-content:center;color:var(--navy);font-weight:700}.module-card h2{font-size:25px;margin:18px 0}.module-card p{color:#444;font-size:18px;line-height:1.55;min-height:84px}.module-card span{height:52px;font-size:17px;margin-top:24px}
.panel-card{background:#fff;border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow);padding:26px;margin-bottom:30px}.panel-card h2{margin:0 0 26px;font-size:22px}.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);text-align:center}.stats-grid div{border-right:1px solid #ddd}.stats-grid div:last-child{border-right:0}.stats-grid strong{display:block;font-size:36px}.stats-grid span{display:block;color:#555;margin-top:10px}.activity-card{min-height:170px}.activity-card p{text-align:center;color:#666;margin-top:55px}.placeholder{margin-top:60px}.placeholder h1{font-size:34px}.placeholder p{font-size:20px;line-height:1.6;color:#555}footer{text-align:center;color:#777;padding:55px 20px 35px;font-size:17px}
@media(max-width:900px){.modules-grid{grid-template-columns:1fr 1fr}.container{padding-top:70px}.brand-script.large{font-size:46px}.brand-script{font-size:46px}.brand-subtitle{font-size:28px}}
@media(max-width:560px){.login-wrapper{padding-top:78px}.brand-login{margin-bottom:58px}.login-logo{max-width:360px}.brand-script{font-size:38px}.brand-subtitle{font-size:24px}.login-card h1{font-size:28px}input{height:54px;font-size:17px}.primary-btn{height:54px;font-size:18px}.topbar{height:66px;padding:0 16px}.brand-small span{font-size:19px}.logout{font-size:15px}.container{padding:48px 16px 26px}.modules-grid{grid-template-columns:1fr}.stats-grid{grid-template-columns:1fr 1fr;gap:22px}.stats-grid div{border-right:0}.hero-brand{margin-bottom:48px}}


/* V3: Moduł Produkty */
.brand-small img{display:block;height:48px;width:auto;object-fit:contain;filter:brightness(0) invert(1)}
.panel-logo{display:block;max-width:520px;width:min(100%,520px);margin:0 auto}.products-container{padding-top:55px}.products-header{display:flex;justify-content:space-between;align-items:center;gap:24px}.products-header h1{margin:0 0 8px;font-size:34px}.products-header p{margin:0;color:var(--muted);font-size:18px}.next-code-box{min-width:190px;border:1px solid var(--border);border-radius:12px;padding:18px;text-align:center;background:#fbfbfb}.next-code-box span{display:block;color:var(--muted);font-size:14px;margin-bottom:8px}.next-code-box strong{font-size:42px;color:var(--navy)}.product-form-card h2{margin-top:0}.product-form{display:grid;gap:24px}.form-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}.product-form label span,.variant-switch span{display:block;font-weight:700;margin-bottom:8px;color:#333}.product-form input{height:48px;font-size:16px}.variant-switch{display:flex;align-items:center;gap:22px;background:#f7f7f7;border:1px solid var(--border);border-radius:12px;padding:16px 18px}.variant-switch label{display:flex;align-items:center;gap:8px;font-weight:600}.variant-switch input{width:auto;height:auto}.system-preview{border:1px dashed #b8b8b8;border-radius:12px;padding:16px 18px;background:#fff}.system-preview span{color:var(--muted);margin-right:10px}.system-preview strong{color:var(--navy);font-size:18px}.hidden{display:none!important}.variants-box{border:1px solid var(--border);border-radius:12px;padding:18px;background:#fcfcfc}.variants-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.variants-top h3{margin:0}.secondary-btn{border:1px solid var(--navy);background:#fff;color:var(--navy);border-radius:8px;padding:10px 14px;font-weight:700;cursor:pointer}.variant-row{display:grid;grid-template-columns:1fr 1.5fr 1fr 1fr 2fr 42px;gap:12px;align-items:end;background:#fff;border:1px solid #e2e2e2;border-radius:12px;padding:14px;margin-bottom:12px}.variant-preview{min-height:48px;display:flex;flex-direction:column;justify-content:center;border:1px dashed #d0d0d0;border-radius:8px;padding:8px 10px}.variant-preview span{font-size:12px;color:var(--muted)}.variant-preview strong{font-size:14px;color:var(--navy);word-break:break-word}.remove-variant{height:42px;border:0;border-radius:8px;background:#eee;font-size:26px;cursor:pointer}.save-product{width:260px}.alert-success{background:#e8fff0;color:#146b31}.table-wrap{overflow-x:auto}.products-table{width:100%;border-collapse:collapse;font-size:15px}.products-table th,.products-table td{border-bottom:1px solid #e5e5e5;padding:13px 10px;text-align:left}.products-table th{background:#f7f7f7;color:#333}.products-table td strong{color:var(--navy)}.empty-state{text-align:center;color:var(--muted);padding:30px}
@media(max-width:980px){.form-grid{grid-template-columns:1fr 1fr}.variant-row{grid-template-columns:1fr 1fr}.products-header{align-items:flex-start;flex-direction:column}.save-product{width:100%}}
@media(max-width:560px){.form-grid{grid-template-columns:1fr}.variant-switch{align-items:flex-start;flex-direction:column}.brand-small img{height:38px}.products-container{padding-top:35px}}
/* V4: poprawki produktów */
.price-field{position:relative;display:flex;align-items:center}
.price-field input{padding-right:46px}
.price-field em{position:absolute;right:15px;font-style:normal;font-weight:700;color:#555;pointer-events:none}
.actions-cell{display:flex;align-items:center;gap:8px}
.actions-cell form{margin:0}
.icon-btn{width:36px;height:36px;border:1px solid #d8d8d8;border-radius:8px;background:#fff;color:var(--navy);display:inline-flex;align-items:center;justify-content:center;font-size:18px;cursor:pointer;line-height:1}
.icon-btn.danger{color:#9b1c1c}
.product-code{font-weight:800;color:var(--navy);white-space:nowrap}
.form-grid.two-cols{grid-template-columns:1fr 1fr}
@media(max-width:560px){.form-grid.two-cols{grid-template-columns:1fr}.actions-cell{gap:6px}.icon-btn{width:34px;height:34px}}


/* v5 - lista produktów jako ekran startowy modułu */
.add-product-btn{
  min-width:190px;
  padding:0 20px;
  text-align:center;
}
.list-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-bottom:20px;
}
.records-info{
  color:var(--muted);
  font-weight:700;
}
.check-col{
  width:42px;
  text-align:center;
}
.products-table input[type="checkbox"]{
  width:18px;
  height:18px;
  padding:0;
  accent-color:var(--navy);
}
.pagination-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin-top:22px;
  flex-wrap:wrap;
}
.per-page-form label{
  color:#444;
  font-weight:600;
  display:flex;
  align-items:center;
  gap:10px;
}
.per-page-form select{
  height:40px;
  border:1px solid var(--border);
  border-radius:8px;
  padding:0 12px;
  background:#fff;
  font-size:15px;
}
.pagination{
  display:flex;
  align-items:center;
  gap:14px;
  color:#333;
}
.pagination a,
.pagination .disabled{
  border:1px solid var(--border);
  border-radius:8px;
  padding:10px 14px;
  background:#fff;
}
.pagination .disabled{
  color:#aaa;
}
.empty-state{
  margin:0;
  color:var(--muted);
  font-size:17px;
}


/* v7 - pomocniczy kalkulator NBP */
.nbp-calculator{
  border:1px solid var(--border);
  border-radius:12px;
  padding:20px;
  margin:24px 0;
  background:#fbfbfb;
}
.nbp-title h3{
  margin:0 0 6px;
  font-size:20px;
}
.nbp-title p{
  margin:0 0 18px;
  color:var(--muted);
  line-height:1.45;
}
.nbp-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
}
.nbp-actions{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  margin-top:16px;
}
.nbp-actions #nbpInfo{
  color:var(--muted);
  font-weight:600;
}
@media(max-width:900px){
  .nbp-grid{grid-template-columns:repeat(2,1fr);}
}
@media(max-width:560px){
  .nbp-grid{grid-template-columns:1fr;}
}


/* v8 - data dodania */
.products-table td{
  vertical-align:middle;
}


/* v10 - kalkulator Włochy i zysk */
.italy-switch{
  margin:22px 0 8px;
}
.profit-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:16px;
  margin-top:16px;
}
@media(max-width:560px){
  .profit-grid{grid-template-columns:1fr;}
}


/* v14 - tekstowe logo w topbar */
.brand-small-text{
  font-family:"Brush Script MT","Segoe Script","Lucida Handwriting",cursive;
  font-size:34px;
  color:#fff;
  line-height:1;
  letter-spacing:.5px;
}


/* v15 - kompaktowy kalkulator dla Polski */
.poland-compact{
  display:grid;
  grid-template-columns:1.25fr auto 1fr 1fr;
  gap:12px;
  align-items:end;
  margin-top:16px;
  padding:14px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
}
.poland-compact .secondary-btn{
  height:54px;
  white-space:nowrap;
  padding:0 18px;
}
.italy-profit-fields{
  margin-top:16px;
}
@media(max-width:900px){
  .poland-compact{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:560px){
  .poland-compact{
    grid-template-columns:1fr;
  }
}


/* v16 - kalkulator Polski w jednym kompaktowym pasku */
.poland-compact{
  display:grid;
  grid-template-columns:1.5fr auto 1fr 1fr;
  gap:12px;
  align-items:end;
  margin-top:16px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
}
.poland-compact label{
  margin:0;
}
.poland-compact .secondary-btn{
  height:54px;
  white-space:nowrap;
  padding:0 18px;
  align-self:end;
  box-shadow:none;
  background:#fff;
  color:var(--navy);
  border:1px solid var(--navy);
}
.poland-compact .price-field input[readonly]{
  background:#fafafa;
}
.italy-profit-fields{
  display:none !important;
}
@media(max-width:900px){
  .poland-compact{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:560px){
  .poland-compact{
    grid-template-columns:1fr;
  }
}


/* v17 - export produktów */
.export-grid{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:24px;
}
.export-card{
  border:1px solid var(--border);
  border-radius:12px;
  padding:24px;
  background:#fff;
}
.export-card h2{
  margin:0 0 12px;
}
.export-card p{
  color:var(--muted);
  line-height:1.45;
}
.export-card strong{
  display:block;
  font-size:42px;
  margin:20px 0 4px;
}
.export-card span{
  display:block;
  color:var(--muted);
  margin-bottom:22px;
}
.export-secondary{
  height:54px;
}
.products-actions-top{
  display:flex;
  justify-content:flex-start;
  margin-bottom:14px;
}
.export-selected-btn{
  height:46px;
  padding:0 18px;
}
@media(max-width:800px){
  .export-grid{
    grid-template-columns:1fr;
  }
}


/* v20 - szeroki układ produktu i zysk dla Włoch */
.product-form .form-grid{
  grid-template-columns:repeat(5, 1fr);
  align-items:end;
}
.product-form .form-grid label{
  min-width:0;
}
.nbp-grid{
  grid-template-columns:repeat(4, 1fr);
}
.italy-profit-row{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:16px;
  margin-top:16px;
}
.italy-profit-row.hidden{
  display:none !important;
}
.italy-profit-row .price-field input[readonly]{
  background:#fafafa;
}
@media(max-width:1100px){
  .product-form .form-grid{
    grid-template-columns:repeat(3, 1fr);
  }
}
@media(max-width:760px){
  .product-form .form-grid,
  .nbp-grid,
  .italy-profit-row{
    grid-template-columns:1fr;
  }
}


/* v21 - kompaktowy widok 100% Chrome jak dawniej 75% */
body{
  font-size:13px;
}
.topbar{
  height:52px;
  padding:0 20px;
}
.brand-small-text{
  font-size:24px;
}
.logout,.back{
  font-size:14px;
}
.container{
  max-width:1040px;
  padding:52px 24px 28px;
}
.panel-card{
  padding:20px;
  margin-bottom:22px;
}
.products-header{
  align-items:center;
}
.products-header h1{
  font-size:28px;
  margin:0 0 8px;
}
.products-header p{
  font-size:14px;
}
.next-code-box{
  padding:14px 20px;
}
.next-code-box strong{
  font-size:34px;
}
.product-form-card h2,
.panel-card h2{
  font-size:20px;
}
input{
  height:42px;
  font-size:14px;
  padding:0 12px;
}
.price-field em{
  right:12px;
  font-size:13px;
}
.variant-switch{
  padding:14px 16px;
  margin:18px 0;
}
.nbp-calculator{
  padding:16px;
  margin:18px 0;
}
.nbp-title h3{
  font-size:20px;
}
.nbp-title p{
  font-size:13px;
}
.primary-btn,.module-card span{
  height:44px;
  font-size:15px;
}
.secondary-btn{
  min-height:40px;
}
.product-form .form-grid{
  gap:14px;
}
.modules-grid{
  gap:18px;
  margin-bottom:24px;
}
.module-card{
  padding:30px 18px 24px;
}
.module-icon{
  height:46px;
  font-size:34px;
}
.module-card h2{
  font-size:20px;
  margin:12px 0;
}
.module-card p{
  font-size:14px;
  min-height:66px;
}
.welcome{
  margin-bottom:32px;
}
.welcome h1{
  font-size:24px;
}
.welcome p{
  font-size:15px;
}
.stats-grid strong{
  font-size:28px;
}
footer{
  font-size:13px;
}
.italy-profit-row{
  display:grid;
  grid-template-columns:repeat(2,1fr);
  gap:14px;
  margin-top:14px;
}
.italy-profit-row.hidden{
  display:none !important;
}


/* v23 - bezpieczne pola zysku dla Włoch */
.italy-profit-fields-fixed{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:14px;
  margin-top:14px;
}
.italy-profit-fields-fixed.hidden{
  display:none !important;
}

/* v25 - poprawka widoczności zysku dla Włoch */
.italy-profit-row:not(.hidden),
.italy-profit-fields-fixed:not(.hidden){
  display:grid !important;
  grid-template-columns:repeat(2, 1fr);
  gap:14px;
  margin-top:14px;
}


/* v27 - wyszukiwarka, sortowanie, rezerwy i nawigacja modułów */
.topbar-centered{
  position:relative;
  justify-content:space-between;
}
.brand-center-text{
  position:absolute;
  left:50%;
  transform:translateX(-50%);
  font-family:"Brush Script MT","Segoe Script","Lucida Handwriting",cursive;
  font-size:28px;
  color:#fff;
  line-height:1;
  white-space:nowrap;
  pointer-events:none;
}
.quick-nav{
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:auto;
  margin-right:190px;
}
.quick-nav a{
  color:#fff;
  border:1px solid rgba(255,255,255,.35);
  padding:7px 10px;
  border-radius:8px;
  font-size:13px;
  font-weight:700;
  opacity:.95;
}
.quick-nav a:hover{
  background:rgba(255,255,255,.12);
}
.back-strong{
  background:#fff;
  color:var(--navy);
  padding:8px 12px;
  border-radius:8px;
  font-weight:800;
}
.header-actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:flex-start;
}
.small-side-btn{
  height:42px;
  padding:0 14px;
  font-size:13px;
  box-shadow:none;
}
.product-filters{
  padding:16px;
}
.filter-form{
  display:grid;
  grid-template-columns:2fr 1fr auto auto;
  gap:12px;
  align-items:end;
}
.filter-form label span{
  display:block;
  font-size:12px;
  font-weight:800;
  color:#444;
  margin-bottom:6px;
}
.filter-form select{
  width:100%;
  height:42px;
  border:1px solid #c9c9c9;
  border-radius:8px;
  padding:0 12px;
  background:#fff;
}
.filter-btn,
.clear-filter-btn{
  height:42px;
  padding:0 16px;
  font-size:14px;
}
.small-input{
  height:38px;
  font-size:13px;
  padding:0 10px;
}
.reserve-submit-btn{
  height:38px;
  padding:0 14px;
  font-size:13px;
}
@media(max-width:980px){
  .quick-nav{
    display:none;
  }
  .brand-center-text{
    font-size:24px;
  }
  .filter-form{
    grid-template-columns:1fr;
  }
}


/* v28 - wyśrodkowanie przycisków i bezpieczne pola ilości */
.primary-btn,
.secondary-btn,
.small-side-btn,
.reserve-submit-btn,
.export-selected-btn,
.filter-btn,
.clear-filter-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}

input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}

.filter-form{
  grid-template-columns:2fr 1fr 1fr auto auto;
}


/* v29 - zbiorcze rezerwy i dolny przycisk wariantów */
.reserve-title-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin-bottom:18px;
}
.reserve-title-row h2{
  margin:0;
}
.reserve-bulk-btn{
  height:40px;
  padding:0 16px;
  font-size:13px;
  white-space:nowrap;
}
.reserve-bottom-actions{
  display:flex;
  justify-content:flex-start;
  margin-top:16px;
}
.add-variant-bottom{
  height:42px;
  padding:0 16px;
  font-size:13px;
  margin-top:14px;
  width:max-content;
}
@media(max-width:700px){
  .reserve-title-row{
    align-items:flex-start;
    flex-direction:column;
  }
}


/* v30 - ustawienia i zarządzanie użytkownikami */
.top-right-actions{
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:16px;
}
.settings-btn{
  width:42px;
  height:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.35);
  color:#fff;
  font-size:20px;
  font-weight:700;
  background:rgba(255,255,255,.08);
}
.settings-btn:hover{
  background:rgba(255,255,255,.16);
}
.settings-user-form{
  display:grid;
  grid-template-columns:1fr 1fr auto;
  gap:16px;
  align-items:end;
}
.settings-user-form label span{
  display:block;
  margin-bottom:6px;
  font-size:12px;
  font-weight:800;
}
.password-rules{
  grid-column:1 / -1;
  font-size:13px;
  color:#666;
  margin-top:-6px;
}
.settings-save-btn{
  height:44px;
  padding:0 18px;
}
@media(max-width:860px){
  .settings-user-form{
    grid-template-columns:1fr;
  }
}


/* v33 - role i reset haseł */
.settings-user-form select,
.inline-settings-form select{
  height:42px;
  border:1px solid #c9c9c9;
  border-radius:8px;
  padding:0 10px;
  background:#fff;
}
.settings-user-form{
  grid-template-columns:1fr 1fr 1fr auto;
}
.inline-settings-form{
  display:flex;
  gap:8px;
  align-items:center;
}
.inline-settings-form input{
  height:38px;
  font-size:13px;
  min-width:150px;
}
.settings-small-btn{
  height:38px;
  padding:0 12px;
  font-size:13px;
  white-space:nowrap;
}
.settings-table td{
  vertical-align:middle;
}
@media(max-width:980px){
  .settings-user-form{
    grid-template-columns:1fr;
  }
  .inline-settings-form{
    flex-direction:column;
    align-items:stretch;
  }
}


/* v34 - export do bazy */
.export-db-meta{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:14px;
}
.export-db-meta label span,
.export-db-search label span{
  display:block;
  font-size:12px;
  font-weight:800;
  margin-bottom:6px;
}
.export-db-table th,
.export-db-table td{
  white-space:nowrap;
}
.export-db-table td:nth-child(3){
  white-space:normal;
  min-width:260px;
}
.export-db-submit{
  height:42px;
  padding:0 18px;
  font-size:14px;
}
@media(max-width:1000px){
  .export-db-meta{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:650px){
  .export-db-meta{
    grid-template-columns:1fr;
  }
}


/* v35 - moduł faktury */
.invoice-form-grid,
.invoice-item-form{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:14px;
  align-items:end;
}
.invoice-form-grid label span,
.invoice-item-form label span{
  display:block;
  margin-bottom:6px;
  font-size:12px;
  font-weight:800;
}
.invoice-form-grid select,
.invoice-item-form select{
  width:100%;
  height:42px;
  border:1px solid #c9c9c9;
  border-radius:8px;
  padding:0 10px;
  background:#fff;
}
.invoice-summary-grid{
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  gap:12px;
}
.invoice-summary-grid div{
  border:1px solid var(--border);
  border-radius:10px;
  padding:14px;
  background:#fff;
  text-align:center;
}
.invoice-summary-grid span{
  display:block;
  color:#666;
  font-size:12px;
  margin-bottom:8px;
}
.invoice-summary-grid strong{
  display:block;
  font-size:24px;
}
.status-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:5px 9px;
  border-radius:999px;
  font-weight:800;
  font-size:12px;
  background:#eee;
}
.status-zamknięta{
  background:#e8f7ee;
  color:#116b32;
}
.status-niezgodna{
  background:#ffe8e8;
  color:#8b0000;
}
.status-robocza,
.status-do-rozliczenia{
  background:#fff7df;
  color:#7a5200;
}
.invoice-items-table small{
  color:#666;
}
@media(max-width:1050px){
  .invoice-form-grid,
  .invoice-item-form,
  .invoice-summary-grid{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:650px){
  .invoice-form-grid,
  .invoice-item-form,
  .invoice-summary-grid{
    grid-template-columns:1fr;
  }
}


/* v36 - poprawiony flow faktur i szersze kafelki */
.products-container{
  max-width:1380px;
}
.invoice-wide-card{
  padding:24px;
}
.section-help{
  margin-top:-14px;
  margin-bottom:18px;
  color:#666;
  font-size:14px;
}
.invoice-item-form-wide{
  grid-template-columns:2fr .8fr 1fr 1fr 1fr 1.5fr auto;
}
.assign-product-form{
  display:grid;
  grid-template-columns:minmax(260px, 1fr) 80px auto;
  gap:8px;
  align-items:center;
  min-width:520px;
}
.assign-product-form select{
  height:38px;
  border:1px solid #c9c9c9;
  border-radius:8px;
  padding:0 10px;
  background:#fff;
}
.invoice-rw-form{
  margin-bottom:8px;
}
.muted-text{
  color:#777;
  font-style:italic;
}
.invoice-items-table th,
.invoice-items-table td{
  vertical-align:middle;
}
@media(max-width:1200px){
  .invoice-item-form-wide{
    grid-template-columns:1fr 1fr;
  }
  .assign-product-form{
    grid-template-columns:1fr;
    min-width:320px;
  }
}


/* v37 - faktury Polska/Włochy i wiele wariantów do jednej pozycji */
.invoice-origin-switch{
  margin:0;
  height:42px;
  align-items:center;
}
.invoice-origin-italy{
  grid-template-columns:2fr .7fr 1fr 1fr 1fr auto 1.2fr auto;
}
.invoice-origin-poland{
  grid-template-columns:2fr .7fr 1fr 1.4fr auto;
}
.assignment-line{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  border:1px solid var(--border);
  border-radius:8px;
  padding:6px 8px;
  margin-bottom:6px;
  background:#fff;
  font-size:12px;
}
.assignment-line form{
  margin:0;
}
.mini-danger{
  width:22px;
  height:22px;
  border:0;
  border-radius:6px;
  background:#ffe8e8;
  color:#8b0000;
  font-weight:900;
  cursor:pointer;
}
.invoice-items-table td:nth-child(2){
  min-width:280px;
}
@media(max-width:1250px){
  .invoice-origin-italy,
  .invoice-origin-poland{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:700px){
  .invoice-origin-italy,
  .invoice-origin-poland{
    grid-template-columns:1fr;
  }
}


/* v38 - poprawki faktur: NBP, wyszukiwarka produktu, szerszy formularz */
.nbp-info-line{
  margin-top:12px;
  padding:10px 12px;
  border-radius:8px;
  background:#f5f7fa;
  color:#555;
  font-size:13px;
  clear:both;
}
.invoice-origin-italy{
  grid-template-columns:1.6fr .65fr .85fr .85fr .9fr auto 1.1fr auto;
  align-items:end;
}
.invoice-origin-italy label,
.invoice-origin-poland label{
  min-width:0;
}
.assign-product-form{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  min-width:360px;
}
.assign-product-form select,
.assign-product-form input{
  width:100%;
}
.product-search-input{
  border-color:#b9c4d1;
}
@media(max-width:1250px){
  .invoice-origin-italy{
    grid-template-columns:1fr 1fr;
  }
}


/* v39 - etapowe faktury */
.invoice-step-nav{
  display:flex;
  gap:12px;
  align-items:center;
  padding:14px;
}
.step-btn{
  height:40px;
  padding:0 16px;
  border-radius:8px;
  border:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  color:var(--navy);
  background:#fff;
}
.step-btn.active{
  background:var(--navy);
  color:#fff;
  border-color:var(--navy);
}
.invoice-form-actions{
  display:flex;
  flex-direction:column;
  gap:8px;
  align-self:end;
}
.invoice-next-btn{
  height:42px;
  padding:0 16px;
  font-size:14px;
}
.invoice-hidden-stage{
  opacity:.85;
}
@media(max-width:700px){
  .invoice-step-nav{
    flex-direction:column;
    align-items:stretch;
  }
}


/* v40 - widoczne pozycje faktury w etapie 1 */
.invoice-position-cards{
  margin-top:22px;
  border-top:1px solid var(--border);
  padding-top:18px;
}
.invoice-positions-title{
  margin-bottom:12px;
}
.invoice-position-list{
  display:grid;
  gap:10px;
}
.invoice-position-card{
  display:grid;
  grid-template-columns:2fr .7fr .8fr .8fr .9fr auto;
  gap:10px;
  align-items:center;
  border:1px solid var(--border);
  border-radius:10px;
  padding:12px;
  background:#fff;
}
.invoice-position-card div span{
  display:block;
  color:#666;
  font-size:11px;
  font-weight:800;
  margin-bottom:4px;
}
.invoice-position-card div strong{
  font-size:13px;
}
.invoice-position-card-actions{
  display:flex;
  justify-content:flex-start;
}
@media(max-width:1050px){
  .invoice-position-card{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:600px){
  .invoice-position-card{
    grid-template-columns:1fr;
  }
}


/* v41 - informacja o etapach przypisania produktu i kotwice */
.product-stage-info{
  border:1px solid var(--border);
  border-radius:8px;
  padding:8px 10px;
  background:#f7f9fb;
  color:#444;
  font-size:12px;
  line-height:1.35;
}
.product-stage-info span{
  color:#666;
}
html{
  scroll-behavior:smooth;
}
#add-position,
#assign-section{
  scroll-margin-top:80px;
}


/* v43 - usuwanie faktur i podpowiedź etapów faktur */
.invoice-table .actions-cell{
  min-width:130px;
}
.product-stage-info strong{
  display:block;
  margin-bottom:2px;
}


/* v44 - moduł dostawy i weryfikacja */
.delivery-create-form{
  display:grid;
  grid-template-columns:2fr 1.4fr 1.4fr auto;
  gap:14px;
  align-items:end;
}
.delivery-create-form label span{
  display:block;
  font-size:12px;
  font-weight:800;
  margin-bottom:6px;
}
.delivery-create-form select{
  width:100%;
  height:42px;
  border:1px solid #c9c9c9;
  border-radius:8px;
  padding:0 10px;
  background:#fff;
}
.delivery-pdf-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.delivery-pdf-actions h2{
  margin-bottom:4px;
}
.delivery-items-table td,
.delivery-items-table th{
  vertical-align:middle;
}
.status-różnice{
  background:#ffe8e8;
  color:#8b0000;
}
.status-zweryfikowana{
  background:#e8f7ee;
  color:#116b32;
}
.status-robocza{
  background:#fff7df;
  color:#7a5200;
}
@media(max-width:1050px){
  .delivery-create-form{
    grid-template-columns:1fr 1fr;
  }
  .delivery-pdf-actions{
    flex-direction:column;
    align-items:flex-start;
  }
}
@media(max-width:650px){
  .delivery-create-form{
    grid-template-columns:1fr;
  }
}


/* v46 - anuluj produkt i suma wariantów */
.variant-bottom-row{
  display:flex;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
  margin-top:14px;
}
.variant-bottom-row .add-variant-bottom{
  margin-top:0;
}
.variant-sum-box{
  min-height:42px;
  display:flex;
  align-items:center;
  gap:6px;
  border:1px solid var(--border);
  border-radius:8px;
  padding:0 14px;
  background:#f7f9fb;
  color:#333;
  font-weight:700;
}
.variant-sum-box span{
  color:#666;
  font-size:13px;
}
.variant-sum-box strong{
  font-size:20px;
  color:var(--navy);
}
.variant-sum-box em{
  font-style:normal;
  color:#666;
}
.product-form-actions{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:12px;
  margin-top:22px;
}
.cancel-product-btn{
  height:54px;
  padding:0 22px;
  box-shadow:none;
}
@media(max-width:560px){
  .product-form-actions{
    flex-direction:column-reverse;
    align-items:stretch;
  }
}


/* v47 - licznik wariantów */
.variant-count-box{
  min-height:42px;
  display:flex;
  align-items:center;
  gap:6px;
  border:1px solid var(--border);
  border-radius:8px;
  padding:0 14px;
  background:#fff7ea;
  color:#333;
  font-weight:700;
}
.variant-count-box span{
  color:#666;
  font-size:13px;
}
.variant-count-box strong{
  font-size:20px;
  color:var(--navy);
}


/* v49 - przyjęcia magazynowe bez wyboru faktury */
.delivery-create-form{
  display:grid;
  grid-template-columns:1.5fr 1.5fr auto;
  gap:14px;
  align-items:end;
}
.delivery-create-form label span{
  display:block;
  font-size:12px;
  font-weight:800;
  margin-bottom:6px;
}
.status-sprawdzone{
  background:#e8f7ee;
  color:#116b32;
}


/* v64 user column */
.user-col{
  text-align:center;
  vertical-align:middle;
  font-weight:800;
  color:#10253B;
  width:42px;
}
.products-table th:nth-last-child(2),
.products-table td.user-col{
  text-align:center;
}
.actions{
  text-align:center;
  white-space:nowrap;
}


/* v64 actions cell */
.actions-cell{
  text-align:center;
  white-space:nowrap;
}
.user-col{
  text-align:center;
  vertical-align:middle;
  font-weight:800;
  color:#10253B;
  width:42px;
}


/* v65 delivery groups */
.delivery-add-product-form{
  display:grid;
  grid-template-columns:1fr 2fr 1fr 1fr auto;
  gap:14px;
  align-items:end;
}
.delivery-add-product-form label span{
  display:block;
  font-size:12px;
  font-weight:800;
  margin-bottom:6px;
}
.delivery-add-product-form select{
  width:100%;
  height:42px;
  border:1px solid #c9c9c9;
  border-radius:8px;
  padding:0 10px;
  background:#fff;
}
.header-actions{
  display:flex;
  gap:10px;
  align-items:center;
}
@media(max-width:1100px){
  .delivery-add-product-form{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:650px){
  .delivery-add-product-form{
    grid-template-columns:1fr;
  }
}


/* v66 delivery checkbox picker */
.delivery-products-picker{
  max-height:520px;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:10px;
}
.delivery-product-filter{
  margin-bottom:12px;
}
.delivery-product-filter label span{
  display:block;
  font-size:12px;
  font-weight:800;
  margin-bottom:6px;
}
.delivery-product-filter input{
  max-width:420px;
}


/* v67 sticky topbar */
.topbar{
  position: sticky;
  top: 0;
  z-index: 1000;
}
body{
  scroll-padding-top: 86px;
}


/* v68 delivery smoother UI */
.delivery-section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:14px;
}
.delivery-list-tools{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.delivery-search-box{
  display:flex;
  align-items:center;
  gap:6px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  padding:0 10px;
  height:42px;
}
.delivery-search-box input{
  border:0;
  outline:0;
  height:38px;
  min-width:220px;
}
.delivery-add-product-card.hidden{
  display:none;
}
@media(max-width:800px){
  .delivery-section-head{
    flex-direction:column;
  }
  .delivery-list-tools{
    justify-content:flex-start;
  }
}


/* v71 updates */
.quick-qty-view{
  cursor:pointer;
  display:inline-flex;
  min-width:34px;
  justify-content:center;
  padding:4px 8px;
  border-radius:6px;
  background:#f4f6f8;
  font-weight:800;
}
.quick-qty-view:hover{
  background:#e9eef4;
}
.quick-qty-edit{
  display:inline-flex;
  gap:6px;
  align-items:center;
}
.quick-qty-input{
  width:58px;
  height:32px;
  border:1px solid var(--border);
  border-radius:6px;
  text-align:center;
}
.mini-save,
.mini-cancel{
  height:32px;
  border:0;
  border-radius:6px;
  padding:0 8px;
  font-weight:800;
  cursor:pointer;
}
.mini-save{
  background:#10253B;
  color:#fff;
}
.mini-cancel{
  background:#eee;
  color:#333;
}
.selected-products-stats{
  display:inline-flex;
  align-items:center;
  margin-left:10px;
  font-weight:800;
  color:#10253B;
}
.variant-warning{
  margin-top:10px;
  padding:10px 12px;
  border-radius:8px;
  background:#ffe8e8;
  color:#8b0000;
  font-weight:800;
}
.input-warning{
  border-color:#d00000 !important;
  background:#fff2f2 !important;
}


/* v72 modal qty */
.selected-products-stats{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  margin:8px 0 8px 10px;
  padding:0 12px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#f7f9fb;
  color:#10253B;
  font-weight:800;
}
.qty-modal-backdrop{
  position:fixed;
  inset:0;
  z-index:5000;
  background:rgba(0,0,0,.35);
  display:flex;
  align-items:center;
  justify-content:center;
}
.qty-modal-backdrop.hidden{
  display:none;
}
.qty-modal{
  position:relative;
  width:min(420px, calc(100vw - 32px));
  background:#fff;
  border-radius:8px;
  box-shadow:0 16px 50px rgba(0,0,0,.22);
  overflow:hidden;
}
.qty-modal h3{
  margin:0;
  padding:16px 20px;
  border-bottom:1px solid #e5e5e5;
  font-size:16px;
}
.qty-modal-close{
  position:absolute;
  top:10px;
  right:12px;
  border:0;
  background:transparent;
  font-size:26px;
  cursor:pointer;
  color:#777;
}
.qty-modal-product{
  padding:18px 20px 6px;
  margin:0;
  color:#333;
}
.qty-modal-change{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:18px;
  padding:8px 20px 14px;
}
.qty-modal-change div{
  text-align:center;
}
.qty-modal-change span{
  display:block;
  color:#777;
  font-size:12px;
}
.qty-modal-change strong{
  font-size:18px;
  color:#10253B;
}
.qty-modal-change small{
  color:#777;
  margin-left:3px;
}
.qty-modal-change input{
  width:62px;
  border:0;
  border-bottom:2px solid #4b238a;
  text-align:center;
  font-size:18px;
  color:#4b238a;
  outline:0;
}
.qty-arrow{
  font-size:24px;
  color:#99a;
}
.qty-modal-hint{
  text-align:center;
  color:#777;
  font-size:12px;
  margin:0 0 14px;
}
.qty-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding:18px 20px;
  background:#f7f7f9;
  border-top:1px solid #e5e5e5;
}


/* v73 fixes */
.qty-modal-change input{
  color:#111 !important;
  border-bottom-color:#111 !important;
}
.qty-modal-change strong{
  color:#111 !important;
}
.selected-products-stats{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:38px;
  margin-left:10px;
  padding:0 12px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#f7f9fb;
  color:#10253B;
  font-weight:800;
  vertical-align:middle;
}
.selected-products-stats.hidden{
  visibility:hidden !important;
}


/* v74 no jump selected stats */
.selected-products-stats{
  min-width:190px;
  visibility:visible;
}
.selected-products-stats.is-empty{
  visibility:hidden;
}


/* v79 invoice delivery link */
.invoice-header-actions{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.delivery-link-info{
  border:1px solid var(--border);
  border-radius:8px;
  padding:8px 10px;
  margin-bottom:6px;
  background:#f7f9fb;
  font-size:12px;
  line-height:1.35;
}
.delivery-link-info strong{
  color:#10253B;
}
.delivery-link-info small{
  display:block;
  margin-top:4px;
  color:#666;
}


/* v80 single product intake */
.single-intake-form{
  display:grid;
  grid-template-columns:1.3fr 2fr .8fr .8fr .8fr 1.2fr auto;
  gap:12px;
  align-items:end;
}
.single-intake-form label span,
.single-intake-current span{
  display:block;
  font-size:12px;
  font-weight:800;
  margin-bottom:6px;
  color:#333;
}
.single-intake-form select{
  width:100%;
  height:42px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  padding:0 10px;
}
.single-intake-current{
  min-height:42px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:8px;
  background:#f7f9fb;
  padding:0 12px;
}
.single-intake-current strong{
  font-size:18px;
  color:#10253B;
}
.single-intake-actions{
  display:flex;
  gap:8px;
}
@media(max-width:1200px){
  .single-intake-form{
    grid-template-columns:1fr 1fr;
  }
}
@media(max-width:650px){
  .single-intake-form{
    grid-template-columns:1fr;
  }
}


/* v81 unresolved table */
.delivery-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:110px;
  height:32px;
  border-radius:999px;
  font-size:12px;
  font-weight:800;
  letter-spacing:.4px;
}
.delivery-ok{
  background:#d9f8df;
  color:#117a2a;
}
.delivery-pending{
  background:#fff3d6;
  color:#9a6a00;
}
.resolved-value{
  color:#117a2a;
}


/* v82 product control table */
.delivery-no-invoice{
  background:#edf0f5;
  color:#4e5968;
}
#productControlTable th,
#productControlTable td{
  white-space:nowrap;
}
#productControlTable td:nth-child(2){
  white-space:normal;
  min-width:260px;
}


/* v83 product control pagination */
.product-control-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}
.per-page-form label{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:800;
  color:#10253B;
}
.per-page-form select{
  height:38px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  padding:0 10px;
}
.product-control-pagination{
  margin-top:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
}
.pagination-info{
  font-weight:800;
  color:#10253B;
}
.secondary-btn.disabled{
  opacity:.45;
  pointer-events:none;
}


/* v85 filters combo search */
.status-filter-label{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:800;
  color:#10253B;
}
.status-filter-label select{
  height:38px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  padding:0 10px;
}
.invoice-product-combo{
  width:100%;
}


/* v87 server search pagination */
.delivery-items-filter-form{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.delivery-items-filter-form select{
  height:42px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  padding:0 10px;
}


/* v88 clear and bottom controls */
.product-control-bottom-bar,
.delivery-bottom-bar{
  margin-top:14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.per-page-bottom-form label{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:800;
  color:#10253B;
}
.per-page-bottom-form select{
  height:38px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  padding:0 10px;
}


/* v89 search button style */
.search-submit-btn{
  min-width:120px;
  height:42px;
  border-radius:10px;
  font-weight:800;
  padding:0 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.clear-search-btn{
  min-width:100px;
  height:42px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}


/* v90 intake date and buttons */
.search-buttons-inline{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.product-control-toolbar{
  justify-content:flex-start;
}
.product-control-toolbar .products-search{
  flex:1;
  min-width:260px;
}
#productControlTable td small{
  color:#666;
  font-size:11px;
}


/* v91 compact product control */
.compact-product-control-table{
  table-layout:fixed;
  width:100%;
  font-size:12px;
}
.compact-product-control-table th{
  white-space:normal !important;
  line-height:1.15;
  text-align:center;
  padding:8px 6px;
}
.compact-product-control-table td{
  padding:7px 6px;
  vertical-align:middle;
}
.compact-product-control-table th:nth-child(1),
.compact-product-control-table td:nth-child(1){
  width:82px;
  white-space:normal !important;
}
.compact-product-control-table th:nth-child(2),
.compact-product-control-table td:nth-child(2){
  width:auto;
  min-width:190px;
  white-space:normal !important;
  text-align:left;
}
.compact-product-control-table th:nth-child(3),
.compact-product-control-table td:nth-child(3),
.compact-product-control-table th:nth-child(4),
.compact-product-control-table td:nth-child(4),
.compact-product-control-table th:nth-child(5),
.compact-product-control-table td:nth-child(5),
.compact-product-control-table th:nth-child(6),
.compact-product-control-table td:nth-child(6),
.compact-product-control-table th:nth-child(7),
.compact-product-control-table td:nth-child(7),
.compact-product-control-table th:nth-child(8),
.compact-product-control-table td:nth-child(8){
  width:74px;
  text-align:center;
}
.compact-product-control-table th:nth-child(4),
.compact-product-control-table td:nth-child(4){
  width:112px;
}
.compact-product-control-table th:nth-child(9),
.compact-product-control-table td:nth-child(9){
  width:104px;
  text-align:left;
}
.compact-product-control-table .delivery-status{
  min-width:86px;
  height:28px;
  font-size:10px;
  padding:0 8px;
}
.compact-product-control-table .product-code{
  font-size:11px;
}
.compact-product-control-table td small{
  font-size:10px;
}


/* v92 fix compact table readability */
.compact-product-control-table{
  table-layout:auto !important;
  font-size:14px !important;
}
.compact-product-control-table th,
.compact-product-control-table td{
  font-size:14px !important;
}
.compact-product-control-table th:nth-child(1),
.compact-product-control-table td:nth-child(1){
  width:110px !important;
  min-width:110px !important;
  white-space:nowrap !important;
}
.compact-product-control-table .product-code{
  font-size:14px !important;
  white-space:nowrap !important;
}
.compact-product-control-table th:nth-child(2),
.compact-product-control-table td:nth-child(2){
  min-width:260px !important;
  white-space:normal !important;
}
.compact-product-control-table th:nth-child(3),
.compact-product-control-table td:nth-child(3),
.compact-product-control-table th:nth-child(5),
.compact-product-control-table td:nth-child(5),
.compact-product-control-table th:nth-child(6),
.compact-product-control-table td:nth-child(6),
.compact-product-control-table th:nth-child(7),
.compact-product-control-table td:nth-child(7),
.compact-product-control-table th:nth-child(8),
.compact-product-control-table td:nth-child(8){
  min-width:78px !important;
  text-align:center !important;
}
.compact-product-control-table th:nth-child(4),
.compact-product-control-table td:nth-child(4){
  min-width:125px !important;
  text-align:center !important;
}
.compact-product-control-table th:nth-child(9),
.compact-product-control-table td:nth-child(9){
  min-width:120px !important;
}
.compact-product-control-table .delivery-status{
  min-width:105px !important;
  height:30px !important;
  font-size:12px !important;
}


/* v93 final fixes */
.compact-product-control-table th:nth-child(8),
.compact-product-control-table td:nth-child(8){
  text-align:center !important;
}
.single-intake-current{
  border:0 !important;
  background:transparent !important;
  padding:0 !important;
  align-self:end;
}
.single-intake-current span{
  display:block !important;
  font-size:12px !important;
  font-weight:800 !important;
  margin-bottom:6px !important;
  color:#333 !important;
}
.single-intake-current strong{
  height:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  border-radius:8px;
  background:#f7f9fb;
  padding:0 12px;
  color:#10253B;
  font-size:18px;
}
.free-codes-table td,
.free-codes-table th{
  text-align:center;
}

/* v93 remaining column override */
.compact-product-control-table th:nth-child(9),
.compact-product-control-table td:nth-child(9){
  text-align:center !important;
}


/* v95 invoices module */
.invoice-tabs-card{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.invoice-tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.invoice-search-toolbar{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.invoice-search-toolbar .products-search{
  flex:1;
  min-width:280px;
}
.center-cell{
  text-align:center !important;
}
.paid-toggle{
  min-width:54px;
  height:30px;
  border:0;
  border-radius:999px;
  font-size:12px;
  font-weight:900;
  cursor:pointer;
  background:#fff3d6;
  color:#9a6a00;
}
.paid-toggle.paid{
  background:#d9f8df;
  color:#117a2a;
}
.invoice-products-table td,
.invoice-table td{
  vertical-align:middle;
}
.input-warning{
  border-color:#d00000 !important;
  background:#fff2f2 !important;
}


/* v96 invoice filters */
.invoice-search-toolbar .per-page-form select{
  height:38px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  padding:0 10px;
}
.paid-toggle.paid{
  min-width:78px;
}


/* v97 code picker and invoice tweaks */
.invoice-substatus{
  display:block;
  text-align:center;
  margin-top:4px;
}
.main-code-picker-row{
  display:flex;
  align-items:center;
  gap:8px;
}
.main-code-picker-row input{
  flex:1;
}
.code-picker-modal{
  width:min(640px, calc(100vw - 32px));
}
.code-ranges-list{
  max-height:420px;
  overflow:auto;
  padding:0 20px 18px;
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
  gap:10px;
}
.code-range-btn{
  border:1px solid var(--border);
  background:#fff;
  border-radius:10px;
  padding:12px;
  text-align:left;
  cursor:pointer;
}
.code-range-btn:hover{
  border-color:#10253B;
  background:#f7f9fb;
}
.code-range-btn strong{
  display:block;
  font-size:16px;
  color:#10253B;
}
.code-range-btn span{
  display:block;
  margin-top:4px;
  color:#666;
  font-size:12px;
  font-weight:800;
}


/* v98 free codes validation */
.next-code-box-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.main-code-picker-row{
  display:flex;
  align-items:center;
  gap:8px;
}
.main-code-picker-row input{
  flex:1;
}
.code-picker-modal{
  width:min(640px, calc(100vw - 32px));
}
.code-ranges-list{
  max-height:420px;
  overflow:auto;
  padding:0 20px 18px;
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
  gap:10px;
}
.code-range-btn{
  border:1px solid var(--border);
  background:#fff;
  border-radius:10px;
  padding:12px;
  text-align:left;
  cursor:pointer;
}
.code-range-btn:hover{
  border-color:#10253B;
  background:#f7f9fb;
}
.code-range-btn strong{
  display:block;
  font-size:16px;
  color:#10253B;
}
.code-range-btn span{
  display:block;
  margin-top:4px;
  color:#666;
  font-size:12px;
  font-weight:800;
}
.input-warning{
  border-color:#d00000 !important;
  background:#fff2f2 !important;
}


/* v99 add product code UX */
.main-code-top-warning{
  margin:0 0 14px 0;
}
.product-form label input#mainCode{
  width:100%;
}


/* v101 code data fix */
.main-code-top-warning{
  margin:0 0 14px 0;
}
.product-form label input#mainCode{
  width:100%;
}


/* v102 mobile responsive + BS favicon support */
@media (max-width: 820px){
  body{
    font-size:15px;
    overflow-x:hidden;
  }

  .container,
  .products-container{
    width:100%;
    max-width:100%;
    padding:12px;
    box-sizing:border-box;
  }

  .topbar{
    position:sticky;
    top:0;
    z-index:1000;
    min-height:auto;
    padding:8px 10px;
    gap:8px;
    flex-wrap:wrap;
  }

  .topbar-centered{
    justify-content:center;
  }

  .top-left,
  .top-right-actions{
    width:100%;
    display:flex;
    justify-content:center;
    gap:8px;
    flex-wrap:wrap;
  }

  .quick-nav{
    order:3;
    width:100%;
    display:flex;
    gap:6px;
    overflow-x:auto;
    padding:4px 0;
    justify-content:flex-start;
  }

  .quick-nav a{
    white-space:nowrap;
    padding:8px 10px;
    border:1px solid var(--border);
    border-radius:8px;
    background:#fff;
  }

  .brand-center-text{
    order:2;
    width:100%;
    text-align:center;
    font-size:18px;
  }

  .panel-card{
    padding:14px;
    border-radius:12px;
  }

  .products-header{
    flex-direction:column;
    align-items:stretch;
    gap:14px;
  }

  .products-header h1{
    font-size:26px;
  }

  .header-actions,
  .top-right-actions,
  .reserve-bottom-actions,
  .single-intake-actions,
  .delivery-list-tools,
  .product-control-bottom-bar,
  .delivery-bottom-bar,
  .invoice-tabs,
  .invoice-search-toolbar,
  .product-control-toolbar{
    width:100%;
    display:flex;
    flex-direction:column;
    align-items:stretch;
  }

  .header-actions a,
  .header-actions button,
  .primary-btn,
  .secondary-btn,
  .settings-small-btn,
  .search-submit-btn,
  .clear-search-btn,
  .add-product-btn,
  .small-side-btn,
  .export-selected-btn{
    width:100%;
    min-height:44px;
    justify-content:center;
    box-sizing:border-box;
  }

  .form-grid,
  .nbp-grid,
  .poland-compact,
  .italy-profit-row,
  .italy-profit-fields-fixed,
  .single-intake-form,
  .delivery-create-form,
  .filter-form{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:12px;
  }

  input,
  select,
  textarea,
  .price-field input{
    width:100% !important;
    min-height:42px;
    box-sizing:border-box;
    font-size:16px;
  }

  .price-field{
    width:100%;
  }

  .variant-switch{
    flex-direction:column;
    align-items:flex-start;
    gap:8px;
  }

  .next-code-box{
    width:100%;
    justify-content:space-between;
  }

  .next-code-box-actions{
    align-items:stretch;
  }

  .table-wrap{
    width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  .products-table{
    min-width:760px;
  }

  .compact-product-control-table{
    min-width:980px;
  }

  .invoice-table,
  .invoice-products-table,
  .delivery-items-table{
    min-width:860px;
  }

  .products-actions-top{
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:8px;
  }

  .selected-products-stats{
    margin-left:0;
    width:100%;
    box-sizing:border-box;
  }

  .delivery-search-box{
    width:100%;
  }

  .pagination,
  .product-control-pagination{
    flex-direction:column;
    align-items:stretch;
    gap:8px;
  }

  .pagination-info{
    text-align:center;
  }

  .qty-modal,
  .code-picker-modal{
    width:calc(100vw - 24px) !important;
    max-height:90vh;
  }

  .code-ranges-list{
    grid-template-columns:1fr;
    max-height:55vh;
  }
}

@media (max-width: 520px){
  .products-header h1{
    font-size:23px;
  }

  .panel-card{
    padding:12px;
  }

  .status-pill,
  .delivery-status{
    font-size:11px;
  }

  .quick-nav a{
    font-size:13px;
  }
}


/* v103 mobile hamburger */
.mobile-menu-toggle{
  display:none;
}

@media (max-width: 820px){

  .topbar{
    display:grid;
    grid-template-columns:44px 1fr 44px;
    align-items:center;
    gap:8px;
    padding:10px 12px;
  }

  .top-left{
    width:auto;
    justify-content:flex-start;
  }

  .top-right-actions{
    width:auto;
    justify-content:flex-end;
  }

  .brand-center-text{
    width:auto;
    order:initial;
    font-size:18px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .back,
  .settings-btn{
    min-width:44px;
    min-height:44px;
    display:flex;
    align-items:center;
    justify-content:center;
  }

  .logout{
    display:none;
  }

  .quick-nav{
    position:fixed;
    top:64px;
    left:0;
    right:0;
    background:#10253B;
    padding:12px;
    display:none;
    flex-direction:column;
    gap:10px;
    z-index:1200;
    border-top:1px solid rgba(255,255,255,.1);
    box-shadow:0 10px 30px rgba(0,0,0,.18);
  }

  .quick-nav.mobile-open{
    display:flex;
  }

  .quick-nav a{
    width:100%;
    background:#fff;
    color:#10253B;
    border:none;
    font-weight:700;
    text-align:center;
  }

  .mobile-menu-toggle{
    display:flex;
    width:44px;
    height:44px;
    border:1px solid rgba(255,255,255,.15);
    background:#fff;
    border-radius:10px;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    font-size:22px;
    font-weight:700;
    color:#10253B;
  }
}


/* v104 fixed mobile topbar */
@media (max-width: 820px){
  .topbar.topbar-centered,
  .topbar{
    display:grid !important;
    grid-template-columns:48px 1fr 48px !important;
    align-items:center !important;
    gap:8px !important;
    padding:6px 8px !important;
    min-height:56px !important;
    position:sticky !important;
    top:0 !important;
    z-index:3000 !important;
    overflow:visible !important;
  }

  .mobile-menu-toggle{
    grid-column:1 !important;
    grid-row:1 !important;
    display:flex !important;
    width:44px !important;
    height:44px !important;
    border:0 !important;
    border-radius:10px !important;
    background:#fff !important;
    color:#10253B !important;
    align-items:center !important;
    justify-content:center !important;
    font-size:24px !important;
    font-weight:900 !important;
    cursor:pointer !important;
    box-shadow:0 2px 8px rgba(0,0,0,.12) !important;
    z-index:3100 !important;
  }

  .brand-center-text{
    grid-column:2 !important;
    grid-row:1 !important;
    width:auto !important;
    order:initial !important;
    text-align:center !important;
    font-size:15px !important;
    line-height:1 !important;
    white-space:nowrap !important;
    overflow:hidden !important;
    text-overflow:ellipsis !important;
    pointer-events:none !important;
  }

  .top-left{
    display:none !important;
  }

  .top-right-actions{
    grid-column:3 !important;
    grid-row:1 !important;
    width:auto !important;
    display:flex !important;
    justify-content:flex-end !important;
    align-items:center !important;
    position:static !important;
    margin:0 !important;
    padding:0 !important;
  }

  .settings-btn{
    width:44px !important;
    height:44px !important;
    min-width:44px !important;
    min-height:44px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    border-radius:10px !important;
    background:#fff !important;
    color:#10253B !important;
    position:static !important;
    margin:0 !important;
    box-shadow:0 2px 8px rgba(0,0,0,.12) !important;
  }

  .logout{
    display:none !important;
  }

  .quick-nav{
    position:absolute !important;
    top:56px !important;
    left:8px !important;
    right:8px !important;
    width:auto !important;
    background:#10253B !important;
    padding:10px !important;
    display:none !important;
    flex-direction:column !important;
    gap:8px !important;
    z-index:3200 !important;
    border-radius:0 0 12px 12px !important;
    box-shadow:0 12px 28px rgba(0,0,0,.2) !important;
    overflow:visible !important;
  }

  .quick-nav.mobile-open{
    display:flex !important;
  }

  .quick-nav a{
    width:100% !important;
    min-height:42px !important;
    box-sizing:border-box !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    background:#fff !important;
    color:#10253B !important;
    border:0 !important;
    border-radius:8px !important;
    font-weight:800 !important;
    text-decoration:none !important;
  }

  main.container,
  .container,
  .products-container{
    padding-top:12px !important;
  }
}


/* v108 invoice assign cards */
.invoice-assign-cards{
  display:flex;
  flex-direction:column;
  gap:16px;
}
.invoice-assign-card{
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  padding:16px;
  box-shadow:0 8px 24px rgba(16,37,59,.06);
}
.invoice-assign-main{
  display:grid;
  grid-template-columns:minmax(220px, 1.1fr) 2fr;
  gap:16px;
  align-items:start;
  border-bottom:1px solid var(--border);
  padding-bottom:14px;
}
.invoice-assign-main span,
.invoice-assign-actions label span{
  display:block;
  font-size:12px;
  font-weight:800;
  color:#555;
  margin-bottom:6px;
}
.invoice-assign-main h3{
  margin:0;
  font-size:22px;
  color:#10253B;
}
.invoice-assign-stats{
  display:grid;
  grid-template-columns:repeat(5, minmax(90px, 1fr));
  gap:10px;
}
.invoice-assign-stats div{
  background:#f7f9fb;
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px;
  text-align:center;
}
.invoice-assign-stats strong{
  display:block;
  font-size:18px;
  color:#10253B;
}
.invoice-assign-stats small{
  display:block;
  margin-top:3px;
  color:#666;
}
.ok-text{
  color:#117a2a !important;
}
.bad-text{
  color:#b00020 !important;
}
.invoice-assign-body{
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:14px;
  padding:14px 0;
}
.invoice-assigned-box,
.invoice-delivery-box{
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  background:#fbfcfd;
}
.invoice-assigned-box h4,
.invoice-delivery-box h4{
  margin:0 0 10px;
  color:#10253B;
}
.assignment-line-card{
  justify-content:space-between;
  gap:10px;
}
.invoice-assign-actions{
  display:grid;
  grid-template-columns:1fr auto;
  gap:14px;
  align-items:start;
}
.invoice-assign-product-form{
  display:grid;
  grid-template-columns:1.6fr .5fr;
  gap:10px;
  align-items:end;
}
.invoice-assign-product-form .product-stage-info{
  grid-column:1 / -1;
}
.invoice-assign-product-form button{
  grid-column:1 / -1;
}
.invoice-rw-actions{
  display:flex;
  gap:8px;
  align-items:flex-start;
}
.invoice-rw-actions .invoice-rw-form{
  display:grid;
  grid-template-columns:80px minmax(120px, 1fr) auto;
  gap:8px;
}
@media(max-width: 1000px){
  .invoice-assign-main,
  .invoice-assign-body,
  .invoice-assign-actions{
    grid-template-columns:1fr;
  }
  .invoice-assign-stats{
    grid-template-columns:repeat(2, 1fr);
  }
  .invoice-assign-product-form{
    grid-template-columns:1fr;
  }
  .invoice-rw-actions{
    flex-direction:column;
    align-items:stretch;
  }
  .invoice-rw-actions .invoice-rw-form{
    grid-template-columns:1fr;
  }
}


/* v109 invoice stock and rw layout */
.invoice-assign-actions{
  grid-template-columns:minmax(0, 1fr) 430px;
  align-items:start;
}
.invoice-rw-actions{
  align-self:start;
  padding-top:24px;
}
.invoice-rw-actions .invoice-rw-form{
  display:grid;
  grid-template-columns:80px minmax(120px, 1fr) auto;
  gap:8px;
  align-items:center;
}
.invoice-rw-actions .icon-btn{
  margin-top:0;
}
.product-stage-info{
  line-height:1.55;
}
.product-stage-info strong{
  color:#10253B;
}
@media(max-width: 1100px){
  .invoice-assign-actions{
    grid-template-columns:1fr;
  }
  .invoice-rw-actions{
    padding-top:0;
  }
}


/* v110 compact product info */
.invoice-assign-product-form .product-stage-info{
  min-height:auto;
  padding:8px 10px;
  background:#f7f9fb;
  border:1px solid var(--border);
  border-radius:8px;
  line-height:1.25;
  max-height:none;
  overflow:visible;
}
.product-info-chips{
  display:grid;
  grid-template-columns:repeat(2, minmax(120px, 1fr));
  gap:8px;
}
.product-info-chips span{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  padding:7px 9px;
}
.product-info-chips em{
  font-style:normal;
  font-size:11px;
  font-weight:800;
  color:#555;
}
.product-info-chips strong{
  font-size:13px;
  color:#10253B;
  white-space:nowrap;
}
.product-stage-info small{
  display:block;
  margin-top:6px;
  color:#666;
  font-size:11px;
}
.compact-info-empty{
  font-size:12px;
  color:#666;
}
@media(max-width: 700px){
  .product-info-chips{
    grid-template-columns:1fr;
  }
}


/* v111 export faktur */
.invoice-export-table th,
.invoice-export-table td{
  vertical-align:middle;
}
.invoice-export-example{
  margin-top:14px;
  padding:12px;
  border:1px dashed var(--border);
  border-radius:10px;
  background:#f8fafc;
  color:#555;
}
.export-filter-form{
  margin:14px 0;
}


/* v112 export invoice card */
.invoice-export-table th,
.invoice-export-table td{
  vertical-align:middle;
}
.export-filter-form select{
  height:42px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  padding:0 10px;
}


/* v113 invoice export buttons */
.invoice-export-actions{
  margin:0 0 12px 0;
  display:flex;
  justify-content:flex-start;
}
.invoice-export-actions.hidden{
  display:none;
}


/* v114 invoice export pagination */
.invoice-export-actions-placeholder{
  min-height:46px;
  margin:0 0 12px 0;
  display:flex;
  align-items:center;
  justify-content:flex-start;
}
.invoice-export-actions-placeholder.hidden{
  display:flex;
}
.invoice-export-actions-placeholder.is-invisible{
  visibility:hidden;
}
.export-filter-form label{
  min-width:160px;
}
.export-filter-form select{
  width:100%;
}


/* v115 invoice export bottom controls */
.invoice-export-bottom-bar{
  margin-top:14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.invoice-export-bottom-bar .product-control-pagination{
  margin-top:0;
}
.invoice-export-actions-placeholder{
  min-height:46px;
  display:flex !important;
  align-items:center;
  justify-content:flex-start;
  margin-bottom:12px;
}
.invoice-export-actions-placeholder.is-invisible{
  visibility:hidden;
}
@media(max-width: 820px){
  .invoice-export-bottom-bar{
    flex-direction:column;
    align-items:stretch;
  }
}


/* v116 export layout cleanup */
.export-list-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.export-list-right{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:8px;
}
.invoice-export-actions-placeholder{
  min-height:auto;
  margin:0;
}
.invoice-export-actions-placeholder.is-invisible{
  visibility:hidden;
}
.invoice-export-bottom-bar{
  margin-top:12px;
  padding-top:12px;
  border-top:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.per-page-bottom-form{
  display:flex;
  align-items:center;
  gap:10px;
}
.per-page-bottom-form label{
  display:flex;
  align-items:center;
  gap:10px;
  margin:0;
}
.per-page-bottom-form span{
  font-weight:700;
}
@media(max-width: 820px){
  .export-list-header,
  .invoice-export-bottom-bar{
    flex-direction:column;
    align-items:stretch;
  }

  .export-list-right{
    align-items:stretch;
  }
}


/* v124 corrections module + unified hamburger */
.mobile-menu-toggle{
  display:flex;
  width:44px;
  height:44px;
  border:0;
  border-radius:10px;
  background:#fff;
  color:#10253B;
  align-items:center;
  justify-content:center;
  font-size:24px;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 2px 8px rgba(0,0,0,.12);
}

.topbar.topbar-centered,
.topbar{
  display:grid;
  grid-template-columns:48px 1fr 48px;
  align-items:center;
  gap:8px;
  overflow:visible;
}

.top-left{
  display:none !important;
}

.brand-center-text{
  grid-column:2;
  text-align:center;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.top-right-actions{
  grid-column:3;
  display:flex;
  justify-content:flex-end;
}

.logout{
  display:none !important;
}

.quick-nav{
  position:absolute;
  top:56px;
  left:8px;
  right:8px;
  width:auto;
  background:#10253B;
  padding:10px;
  display:none;
  flex-direction:column;
  gap:8px;
  z-index:3200;
  border-radius:0 0 12px 12px;
  box-shadow:0 12px 28px rgba(0,0,0,.2);
}

.quick-nav.mobile-open{
  display:flex;
}

.quick-nav a{
  width:100%;
  min-height:42px;
  box-sizing:border-box;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#fff;
  color:#10253B;
  border:0;
  border-radius:8px;
  font-weight:800;
  text-decoration:none;
}

.rw-doc-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(140px, 1fr));
  gap:12px;
}
.rw-notes{
  margin-top:12px;
  display:block;
}
.rw-items{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:14px;
}
.rw-item-row{
  display:grid;
  grid-template-columns:1.5fr .4fr 1fr;
  gap:10px;
  align-items:end;
  padding:12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fbfcfd;
}
.rw-actions{
  display:flex;
  justify-content:space-between;
  gap:10px;
  margin-top:14px;
}
.rw-table td{
  vertical-align:middle;
}
@media(max-width: 900px){
  .rw-doc-grid,
  .rw-item-row{
    grid-template-columns:1fr;
  }
  .rw-actions{
    flex-direction:column;
  }
}


/* v125 topbar/menu fixes */
.topbar.topbar-centered,
.topbar{
  grid-template-columns:56px 1fr auto !important;
  min-height:58px;
}

.brand-center-text{
  grid-column:2 !important;
  justify-self:center !important;
  text-align:center !important;
  width:100% !important;
  font-size:18px;
}

.top-right-actions{
  grid-column:3 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:8px !important;
  min-width:150px;
}

.logout{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  min-height:38px;
  padding:0 12px;
  border-radius:9px;
  background:#fff;
  color:#10253B;
  text-decoration:none;
  font-weight:800;
  box-shadow:0 2px 8px rgba(0,0,0,.10);
  white-space:nowrap;
}

.quick-nav{
  left:8px !important;
  right:auto !important;
  width:max-content !important;
  min-width:190px !important;
  max-width:260px !important;
  padding:8px !important;
}

.quick-nav a{
  justify-content:flex-start !important;
  padding:0 14px !important;
  white-space:nowrap !important;
}

.modules-grid{
  grid-template-columns:repeat(3, minmax(220px, 1fr));
  justify-content:center;
}

.modules-grid .module-card:nth-child(4){
  grid-column:1 / 2;
}

.modules-grid .module-card:nth-child(5){
  grid-column:2 / 3;
}

@media(max-width: 1100px){
  .modules-grid{
    grid-template-columns:repeat(2, minmax(220px, 1fr));
  }
  .modules-grid .module-card:nth-child(4),
  .modules-grid .module-card:nth-child(5){
    grid-column:auto;
  }
}

@media(max-width: 820px){
  .topbar.topbar-centered,
  .topbar{
    grid-template-columns:48px 1fr 48px !important;
  }

  .top-right-actions{
    min-width:0;
  }

  .logout{
    display:none !important;
  }

  .brand-center-text{
    font-size:15px;
  }

  .quick-nav{
    width:max-content !important;
    min-width:170px !important;
    max-width:82vw !important;
  }

  .quick-nav a{
    min-width:150px;
  }

  .modules-grid{
    grid-template-columns:1fr;
  }
}


/* v126 centered header + dashboard layout */
.topbar.topbar-centered,
.topbar{
  position:relative !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-height:58px !important;
  padding:6px 14px !important;
}

.top-menu-actions{
  position:absolute !important;
  left:12px !important;
  top:50% !important;
  transform:translateY(-50%) !important;
  display:flex !important;
  align-items:center !important;
  gap:8px !important;
  z-index:5 !important;
}

.mobile-menu-toggle,
.home-top-btn{
  display:flex !important;
  width:42px !important;
  height:42px !important;
  align-items:center !important;
  justify-content:center !important;
  border-radius:10px !important;
  border:1px solid rgba(255,255,255,.28) !important;
  background:rgba(255,255,255,.08) !important;
  color:#fff !important;
  font-size:22px !important;
  font-weight:900 !important;
  text-decoration:none !important;
  box-shadow:none !important;
}

.home-top-btn{
  font-size:24px !important;
}

.brand-center-text{
  position:absolute !important;
  left:50% !important;
  top:50% !important;
  transform:translate(-50%, -50%) !important;
  width:auto !important;
  max-width:260px !important;
  text-align:center !important;
  justify-self:auto !important;
  grid-column:auto !important;
  pointer-events:none !important;
}

.top-right-actions{
  position:absolute !important;
  right:12px !important;
  top:50% !important;
  transform:translateY(-50%) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
  gap:8px !important;
  min-width:auto !important;
  grid-column:auto !important;
}

.settings-btn{
  background:rgba(255,255,255,.08) !important;
  color:#fff !important;
  border:1px solid rgba(255,255,255,.28) !important;
  box-shadow:none !important;
}

.logout{
  background:transparent !important;
  color:#fff !important;
  border:1px solid rgba(255,255,255,.28) !important;
  box-shadow:none !important;
  min-height:38px !important;
  padding:0 12px !important;
}

.logout:hover,
.mobile-menu-toggle:hover,
.home-top-btn:hover,
.settings-btn:hover{
  background:rgba(255,255,255,.16) !important;
}

.quick-nav{
  top:58px !important;
  left:12px !important;
}

.modules-grid{
  max-width:1050px !important;
  margin:0 auto !important;
  display:grid !important;
  grid-template-columns:repeat(6, minmax(120px, 1fr)) !important;
  gap:22px !important;
  align-items:stretch !important;
  justify-content:center !important;
}

.modules-grid .module-card{
  min-width:0 !important;
}

.modules-grid .module-card:nth-child(1){
  grid-column:1 / 3 !important;
}
.modules-grid .module-card:nth-child(2){
  grid-column:3 / 5 !important;
}
.modules-grid .module-card:nth-child(3){
  grid-column:5 / 7 !important;
}
.modules-grid .module-card:nth-child(4){
  grid-column:2 / 4 !important;
}
.modules-grid .module-card:nth-child(5){
  grid-column:4 / 6 !important;
}

@media(max-width: 1100px){
  .modules-grid{
    max-width:720px !important;
    grid-template-columns:repeat(2, minmax(220px, 1fr)) !important;
  }

  .modules-grid .module-card:nth-child(n){
    grid-column:auto !important;
  }
}

@media(max-width: 820px){
  .topbar.topbar-centered,
  .topbar{
    min-height:56px !important;
    padding:6px 8px !important;
  }

  .top-menu-actions{
    left:8px !important;
    gap:6px !important;
  }

  .mobile-menu-toggle,
  .home-top-btn,
  .settings-btn{
    width:40px !important;
    height:40px !important;
  }

  .home-top-btn{
    display:none !important;
  }

  .brand-center-text{
    max-width:180px !important;
    font-size:15px !important;
  }

  .top-right-actions{
    right:8px !important;
  }

  .logout{
    display:none !important;
  }

  .quick-nav{
    top:56px !important;
    left:8px !important;
  }

  .modules-grid{
    max-width:100% !important;
    grid-template-columns:1fr !important;
  }
}


/* v127 spacing fixes */
.modules-grid{
  row-gap:28px !important;
  margin-bottom:28px !important;
}

.quick-stats,
.dashboard-stats,
.fast-overview,
.szybki-przeglad{
  margin-top:28px !important;
}

.modules-grid + *{
  margin-top:28px !important;
}


/* v128 RW export template + form cleanup */
.rw-doc-grid{
  grid-template-columns:repeat(3, minmax(180px, 1fr)) !important;
}
.rw-doc-grid select,
.rw-item-row select{
  width:100%;
  min-height:42px;
  border:1px solid var(--border);
  border-radius:8px;
  background:#fff;
  padding:0 10px;
  font:inherit;
  color:#10253B;
}
@media(max-width: 900px){
  .rw-doc-grid{
    grid-template-columns:1fr !important;
  }
}


/* v129 RW PDF actions */
.rw-header-actions{
  display:flex;
  align-items:end;
  justify-content:flex-end;
  gap:10px;
  flex-wrap:wrap;
}
.rw-month-form{
  margin:0;
}
.rw-month-form label{
  display:flex;
  flex-direction:column;
  gap:5px;
  font-weight:800;
  color:#333;
}
.rw-month-form input{
  min-height:40px;
  border:1px solid var(--border);
  border-radius:8px;
  padding:0 10px;
  background:#fff;
}
@media(max-width: 820px){
  .rw-header-actions{
    width:100%;
    justify-content:stretch;
    flex-direction:column;
    align-items:stretch;
  }
  .rw-header-actions a,
  .rw-header-actions input{
    width:100%;
    box-sizing:border-box;
  }
}


/* v131 big update */
.admin-bell-wrap{
  position:relative;
}
.admin-bell-btn{
  position:relative;
  width:40px;
  height:40px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.28);
  background:rgba(255,255,255,.08);
  color:#fff;
  cursor:pointer;
}
.admin-bell-btn span{
  position:absolute;
  top:-5px;
  right:-5px;
  background:#d80000;
  color:#fff;
  border-radius:999px;
  min-width:18px;
  height:18px;
  font-size:11px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.admin-bell-panel{
  display:none;
  position:absolute;
  right:0;
  top:48px;
  width:320px;
  max-height:420px;
  overflow:auto;
  background:#fff;
  color:#10253B;
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:0 14px 34px rgba(0,0,0,.22);
  padding:12px;
  z-index:4000;
}
.admin-bell-panel.is-open{
  display:block;
}
.admin-bell-item{
  border-bottom:1px solid var(--border);
  padding:8px 0;
}
.admin-bell-item.is-new{
  background:#fff9e8;
  margin:0 -6px;
  padding:8px 6px;
  border-radius:8px;
}
.admin-bell-item small{
  display:block;
  color:#777;
  margin:2px 0;
}
.admin-bell-item p{
  margin:0;
  font-size:13px;
}
.backup-reminder-card{
  background:#fff1f1;
  border:1px solid #d80000;
  color:#8a0000;
  border-radius:14px;
  padding:14px;
  margin:0 0 16px;
}
.backup-reminder-card strong{
  display:block;
  font-size:18px;
  margin-bottom:5px;
}
.backup-reminder-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.backup-reminder-actions form{
  margin:0;
}
.related-edit-btn.is-hidden{
  display:none !important;
}
.related-main-code{
  display:block;
  max-width:260px;
  margin-bottom:16px;
}
.related-variants{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.related-variant-row{
  display:grid;
  grid-template-columns:.5fr 2fr .55fr .7fr .7fr .45fr;
  gap:8px;
  align-items:end;
  padding:12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fbfcfd;
}
.related-delete{
  text-align:center;
}
.related-actions{
  margin-top:14px;
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.mobile-card-list{
  display:none;
}
@media(max-width: 820px){
  .admin-bell-panel{
    position:fixed;
    left:10px;
    right:10px;
    top:64px;
    width:auto;
  }
  .backup-reminder-actions,
  .related-actions{
    flex-direction:column;
    align-items:stretch;
  }
  .related-variant-row{
    grid-template-columns:1fr;
  }
  .table-wrap{
    overflow-x:auto;
  }
  .products-table{
    font-size:12px;
  }
  .products-table th,
  .products-table td{
    padding:7px 6px;
  }
}


/* v132 stability hotfix */
.topbar,
.topbar.topbar-centered{
  position:sticky !important;
  top:0 !important;
  z-index:5000 !important;
}
.admin-bell-wrap{
  position:relative;
  display:inline-flex;
}
.admin-bell-btn{
  position:relative;
  width:40px;
  height:40px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.28);
  background:rgba(255,255,255,.08);
  color:#fff;
  cursor:pointer;
}
.admin-bell-btn span{
  position:absolute;
  top:-5px;
  right:-5px;
  background:#d80000;
  color:#fff;
  border-radius:999px;
  min-width:18px;
  height:18px;
  font-size:11px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.admin-bell-panel{
  display:none;
  position:absolute;
  right:0;
  top:48px;
  width:320px;
  max-height:420px;
  overflow:auto;
  background:#fff;
  color:#10253B;
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:0 14px 34px rgba(0,0,0,.22);
  padding:12px;
  z-index:6000;
}
.admin-bell-panel.is-open{
  display:block;
}
.admin-bell-item{
  border-bottom:1px solid var(--border);
  padding:8px 0;
}
.admin-bell-item.is-new{
  background:#fff9e8;
  margin:0 -6px;
  padding:8px 6px;
  border-radius:8px;
}
.related-edit-btn.is-hidden{
  display:none !important;
}
@media(max-width:820px){
  .admin-bell-panel{
    position:fixed;
    left:10px;
    right:10px;
    top:64px;
    width:auto;
  }
}


/* v133 outside product + Polish PDF */
.outside-product-card{
  margin:14px 0;
  padding:14px;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fbfcfd;
}
.outside-product-form{
  display:grid;
  grid-template-columns:repeat(6, minmax(120px, 1fr));
  gap:10px;
  align-items:end;
}
.outside-product-form label{
  display:flex;
  flex-direction:column;
  gap:5px;
}
.outside-product-name{
  grid-column:span 2;
}
.outside-product-actions{
  display:flex;
  align-items:end;
}
@media(max-width: 900px){
  .outside-product-form{
    grid-template-columns:1fr;
  }
  .outside-product-name{
    grid-column:auto;
  }
}


/* v134 invoice-RW workflow */
.pending-invoice-rw-card{
  background:#fff8e7;
  border:1px solid #e4a500;
  border-radius:14px;
  padding:14px;
  margin-bottom:16px;
}
.pending-invoice-rw-card h2{
  margin-top:0;
  color:#7a4b00;
}
.pending-invoice-rw-card p{
  color:#7a4b00;
}
.status-niezgodność,
.status-niezgodna{
  background:#ffe0e0 !important;
  color:#9b0000 !important;
}
.status-rozliczone{
  background:#dff7df !important;
  color:#137a13 !important;
}


/* v135 RW usability fixes */
.admin-bell-wrap{display:inline-flex !important; position:relative !important;}
.admin-bell-btn{display:flex !important; align-items:center; justify-content:center;}
.inline-rw-reason-form{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}
.inline-rw-reason-form input{
  min-height:36px;
  border:1px solid var(--border);
  border-radius:8px;
  padding:0 10px;
}
.rw-preview-details summary{
  cursor:pointer;
  font-weight:800;
  color:#10253B;
}
.rw-preview-details p{
  max-width:320px;
  margin:8px 0 0;
  font-size:13px;
}
.rw-actions-cell{
  display:flex;
  gap:8px;
  align-items:center;
}
.rw-actions-cell form{
  margin:0;
}
.rw-edit-form input,
.rw-edit-form textarea,
.rw-edit-form select{
  width:100%;
  box-sizing:border-box;
}
@media(max-width:820px){
  .inline-rw-reason-form{
    flex-direction:column;
    align-items:stretch;
  }
  .rw-actions-cell{
    flex-direction:column;
    align-items:stretch;
  }
}


/* v136 fixes */
.top-menu-actions{
 display:flex;
 align-items:center;
 gap:8px;
}
.back-top-btn{
 border:none;
 background:#fff;
 color:#10253B;
 border-radius:10px;
 width:42px;
 height:42px;
 font-size:20px;
 font-weight:700;
 cursor:pointer;
 box-shadow:0 2px 10px rgba(0,0,0,.15);
}
.admin-bell-btn{
 width:42px!important;
 height:42px!important;
 border:none!important;
 border-radius:10px!important;
 background:#fff!important;
 color:#10253B!important;
 font-size:18px!important;
 cursor:pointer!important;
 box-shadow:0 2px 10px rgba(0,0,0,.15)!important;
}
.one-line-rw{
 display:flex!important;
 flex-direction:row!important;
 align-items:center!important;
 gap:10px!important;
}
.one-line-rw input{
 flex:1!important;
}
.one-line-rw button{
 white-space:nowrap;
}


/* v137 cleanup */
.back-top-btn{
  background:rgba(255,255,255,.08)!important;
  color:#fff!important;
  border:1px solid rgba(255,255,255,.28)!important;
  box-shadow:none!important;
}
.back-top-btn:hover{
  background:rgba(255,255,255,.16)!important;
}
.rw-actions-cell{
  display:flex!important;
  align-items:center!important;
  gap:8px!important;
}
.rw-actions-cell form{
  margin:0!important;
}
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9000;
  padding:20px;
}
.modal-overlay.is-open{
  display:flex;
}
.app-modal{
  width:min(760px, 96vw);
  max-height:86vh;
  overflow:auto;
  background:#fff;
  border-radius:14px;
  box-shadow:0 18px 50px rgba(0,0,0,.35);
}
.app-modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:16px 20px;
  border-bottom:1px solid var(--border);
}
.app-modal-body{
  padding:18px 20px;
}
.modal-close-btn{
  border:0;
  background:#6c757d;
  color:#fff;
  border-radius:8px;
  padding:10px 16px;
  font-weight:800;
  cursor:pointer;
}
.outside-product-form-modal,
.invoice-edit-form-modal{
  display:grid;
  grid-template-columns:repeat(2,minmax(180px,1fr));
  gap:12px;
}
.outside-product-form-modal label,
.invoice-edit-form-modal label{
  display:flex;
  flex-direction:column;
  gap:5px;
}
.modal-full{
  grid-column:1 / -1;
}
@media(max-width:820px){
  .outside-product-form-modal,
  .invoice-edit-form-modal{
    grid-template-columns:1fr;
  }
}


/* v140 delivery/export stability */
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9000;
  padding:20px;
}
.modal-overlay.is-open{
  display:flex;
}
.app-modal{
  width:min(760px, 96vw);
  max-height:86vh;
  overflow:auto;
  background:#fff;
  border-radius:14px;
  box-shadow:0 18px 50px rgba(0,0,0,.35);
}
.app-modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:16px 20px;
  border-bottom:1px solid var(--border);
}
.app-modal-body{
  padding:18px 20px;
}
.modal-close-btn{
  border:0;
  background:#6c757d;
  color:#fff;
  border-radius:8px;
  padding:10px 16px;
  font-weight:800;
  cursor:pointer;
}
.outside-product-form-modal{
  display:grid;
  grid-template-columns:repeat(2,minmax(180px,1fr));
  gap:12px;
}
.outside-product-form-modal label{
  display:flex;
  flex-direction:column;
  gap:5px;
}
.modal-full{
  grid-column:1 / -1;
}
@media(max-width:820px){
  .outside-product-form-modal{
    grid-template-columns:1fr;
  }
}


/* v141 modal delivery fix */
.modal-row-hidden{
  height:0!important;
}
.modal-row-hidden > td{
  padding:0!important;
  border:0!important;
}
.modal-row-hidden .modal-overlay{
  position:fixed!important;
}
.modal-overlay{
  display:none;
}
.modal-overlay.is-open{
  display:flex!important;
}
#deliveryItemsTable{
  visibility:visible!important;
}


/* v142 corrections preview fix */
.rw-inline-preview{
  position:relative;
}
.rw-inline-preview summary{
  list-style:none;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.rw-inline-preview summary::-webkit-details-marker{
  display:none;
}
.rw-inline-preview-box{
  position:absolute;
  right:0;
  top:44px;
  width:360px;
  max-width:80vw;
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  box-shadow:0 14px 38px rgba(0,0,0,.22);
  padding:14px;
  z-index:5000;
  text-align:left;
}
.rw-inline-preview-box p{
  margin:0 0 8px;
  font-size:13px;
}
@media(max-width:820px){
  .rw-inline-preview-box{
    position:fixed;
    left:12px;
    right:12px;
    top:80px;
    width:auto;
    max-width:none;
  }
}


/* v143 corrections modal preview */
.modal-row-hidden{
  height:0!important;
}
.modal-row-hidden > td{
  padding:0!important;
  border:0!important;
}
.modal-row-hidden .modal-overlay{
  position:fixed!important;
}
.modal-overlay{
  display:none;
}
.modal-overlay.is-open{
  display:flex!important;
}
.modal-actions{
  margin-top:14px;
  display:flex;
  justify-content:flex-end;
}


/* v144 corrections safe modal */
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9000;
  padding:20px;
}
.modal-overlay.is-open{
  display:flex!important;
}
.app-modal{
  width:min(760px, 96vw);
  max-height:86vh;
  overflow:auto;
  background:#fff;
  border-radius:14px;
  box-shadow:0 18px 50px rgba(0,0,0,.35);
}
.app-modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:16px 20px;
  border-bottom:1px solid var(--border);
}
.app-modal-body{
  padding:18px 20px;
}


/* v145 opis + backup reminder */
.product-extra-row{
  display:grid;
  grid-template-columns:minmax(260px, 360px) 1fr;
  gap:16px;
  align-items:end;
  margin-top:12px;
}
.product-description-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.product-description-field input{
  min-height:42px;
  border:1px solid var(--border);
  border-radius:8px;
  padding:0 10px;
}
@media(max-width:820px){
  .product-extra-row{
    grid-template-columns:1fr;
  }
}


/* v147 add product JS/layout fix */
.product-extra-row{
  display:grid;
  grid-template-columns:300px minmax(320px, 1fr);
  gap:16px;
  align-items:start;
}
.product-extra-row .italy-switch,
.product-extra-row .product-description-field{
  min-height:58px;
}
.product-extra-row .product-description-field span{
  font-weight:700;
  margin-bottom:6px;
}
.product-extra-row .product-description-field input{
  height:42px;
}
@media(max-width:900px){
  .product-extra-row{
    grid-template-columns:1fr;
  }
}


/* v149 import aktualnego stanu */
.stock-import-form{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:12px;
}
.stock-import-form input[type="file"]{
  border:1px solid var(--border);
  border-radius:10px;
  padding:10px;
  background:#fff;
}
.stock-import-report-card{
  margin-top:16px;
}
.stock-import-status{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  font-weight:800;
  background:#eee;
}


/* v150 export fixes */
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9000;
  padding:20px;
}
.modal-overlay.is-open{
  display:flex!important;
}
.app-modal{
  width:min(1100px, 96vw);
  max-height:86vh;
  overflow:auto;
  background:#fff;
  border-radius:14px;
  box-shadow:0 18px 50px rgba(0,0,0,.35);
}
.app-modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:16px 20px;
  border-bottom:1px solid var(--border);
}
.app-modal-body{
  padding:18px 20px;
}
.modal-close-btn{
  border:0;
  background:#6c757d;
  color:#fff;
  border-radius:8px;
  padding:10px 16px;
  font-weight:800;
  cursor:pointer;
}
.stock-import-modal{
  width:min(1200px, 98vw);
}


/* v151 - Dodaj produkt layout + Export BAZA */
.product-form .form-grid{
  grid-template-columns: minmax(360px, 2fr) minmax(120px, .75fr) minmax(110px, .65fr) minmax(150px, .8fr) minmax(160px, .9fr) !important;
}
.export-status{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  font-weight:800;
  font-size:12px;
}
.export-status.exported{
  background:#ddf7df;
  color:#137a13;
}
.export-status.not-exported{
  background:#fff0c2;
  color:#7a4b00;
}
@media(max-width:1100px){
  .product-form .form-grid{
    grid-template-columns:1fr 1fr !important;
  }
}
@media(max-width:760px){
  .product-form .form-grid{
    grid-template-columns:1fr !important;
  }
}


/* v153 Export BAZA tabs */
.export-tabs{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.export-tab{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:12px 16px;
  border-radius:12px;
  background:#f2f5f8;
  color:#10253B;
  font-weight:900;
  text-decoration:none;
}
.export-tab.active{
  background:#10253B;
  color:#fff;
}
.export-tab span{
  min-width:24px;
  height:24px;
  border-radius:999px;
  background:rgba(255,255,255,.25);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 8px;
}
.export-tab:not(.active) span{
  background:#fff;
}
.missing-info{
  display:inline-flex;
  padding:6px 10px;
  border-radius:10px;
  background:#ffe0e0;
  color:#9b0000;
  font-weight:800;
  font-size:12px;
}
.pagination-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-top:14px;
  flex-wrap:wrap;
}
.pagination-actions{
  display:flex;
  gap:8px;
}


/* v154 Faktury - popup dodawania przypisań */
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9000;
  padding:20px;
}
.modal-overlay.is-open{
  display:flex!important;
}
.app-modal{
  background:#fff;
  border-radius:14px;
  box-shadow:0 18px 50px rgba(0,0,0,.35);
  max-height:88vh;
  overflow:auto;
}
.assign-products-modal{
  width:min(1050px, 98vw);
}
.app-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:16px 20px;
  border-bottom:1px solid var(--border);
}
.app-modal-body{
  padding:18px 20px;
}
.modal-close-btn{
  border:0;
  background:#6c757d;
  color:#fff;
  border-radius:8px;
  padding:10px 16px;
  font-weight:800;
  cursor:pointer;
}
.assign-modal-search-box{
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-bottom:12px;
}
.assign-modal-search{
  min-height:42px;
  border:1px solid var(--border);
  border-radius:10px;
  padding:0 12px;
}
.assign-products-list{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height:52vh;
  overflow:auto;
  padding-right:4px;
}
.assign-product-row{
  display:grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap:12px;
  align-items:center;
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px;
  background:#fbfcfd;
}
.assign-product-check{
  display:flex;
  align-items:center;
  gap:10px;
}
.assign-product-numbers{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.assign-quantity-box{
  display:flex;
  align-items:center;
  gap:6px;
}
.assign-quantity-box input{
  width:90px;
}
.assign-modal-actions{
  margin-top:16px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
}
@media(max-width:820px){
  .assign-product-row{
    grid-template-columns:1fr;
  }
  .assign-product-numbers{
    align-items:flex-start;
  }
}


/* v155 - ładniejszy popup przypisań w Fakturach */
.assign-products-modal{
  width:min(980px, 96vw);
}
.assign-products-list{
  gap:10px;
}
.assign-product-row{
  grid-template-columns: minmax(360px, 1fr) minmax(290px, auto);
  padding:12px 14px;
  background:#fff;
  border:1px solid #d9dee8;
  box-shadow:0 4px 14px rgba(16,37,59,.06);
}
.assign-product-row:hover{
  border-color:#10253B;
  background:#f8fbff;
}
.assign-product-check{
  min-width:0;
}
.assign-product-check input[type="checkbox"]{
  width:22px;
  height:22px;
  flex:0 0 auto;
  accent-color:#10253B;
}
.assign-product-check span{
  display:block;
  min-width:0;
  line-height:1.35;
  overflow-wrap:anywhere;
}
.assign-product-numbers{
  justify-content:flex-end;
  gap:10px;
  font-size:13px;
  color:#333;
}
.assign-product-numbers > span{
  background:#f2f5f8;
  border-radius:999px;
  padding:7px 10px;
  white-space:nowrap;
}
.assign-quantity-box{
  background:#fff;
  border:1px solid #d9dee8;
  border-radius:10px;
  padding:6px 8px;
}
.assign-quantity-box input{
  height:34px;
  border-radius:8px;
}
.assign-modal-search{
  font-size:15px;
}
.app-modal-head h3{
  margin:0;
}
@media(max-width:820px){
  .assign-product-row{
    grid-template-columns:1fr;
  }
  .assign-product-numbers{
    justify-content:flex-start;
  }
}


/* v156 - licznik przypisań, PDF do kodowania, większy kod/nazwa w popupie */
.assign-count-badge{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  font-weight:900;
  white-space:nowrap;
}
.assign-count-badge.assign-ok{
  background:#ddf7df;
  color:#137a13;
}
.assign-count-badge.assign-partial{
  background:#fff0c2;
  color:#7a4b00;
}
.assign-count-badge.assign-empty{
  background:#ffe0e0;
  color:#9b0000;
}
.assign-product-title{
  display:inline!important;
  font-size:16px;
  line-height:1.35;
  white-space:normal;
}
.assign-product-title strong{
  font-size:18px;
  font-weight:950;
  color:#10253B;
}
.assign-product-title em{
  font-style:normal;
  font-size:16px;
  font-weight:800;
  color:#1d2939;
}
@media(max-width:820px){
  .assign-product-title,
  .assign-product-title em{
    font-size:15px;
  }
  .assign-product-title strong{
    font-size:17px;
  }
}


/* v161 compact Export BAZA */
.export-db-compact-table{
  table-layout: fixed;
  width: 100%;
  font-size: 12px;
}
.export-db-compact-table th,
.export-db-compact-table td{
  padding: 7px 6px;
  vertical-align: middle;
}
.export-db-compact-table th:nth-child(1),
.export-db-compact-table td:nth-child(1){
  width: 34px;
  text-align: center;
}
.export-db-compact-table th:nth-child(2),
.export-db-compact-table td:nth-child(2){
  width: 42px;
  text-align: center;
}
.export-db-compact-table th:nth-child(3),
.export-db-compact-table td:nth-child(3){
  width: 78px;
  white-space: nowrap;
}
.export-db-compact-table th:nth-child(4),
.export-db-compact-table td:nth-child(4){
  width: 105px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.export-db-compact-table th:nth-child(5),
.export-db-compact-table td:nth-child(5){
  width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.export-db-compact-table th:nth-child(6),
.export-db-compact-table td:nth-child(6){
  width: 82px;
  white-space: nowrap;
}
.export-db-compact-table th:nth-child(7),
.export-db-compact-table td:nth-child(7){
  width: auto;
  min-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.export-db-compact-table th:nth-child(8),
.export-db-compact-table td:nth-child(8){
  width: 56px;
  text-align: center;
}
.export-db-compact-table th:nth-child(9),
.export-db-compact-table td:nth-child(9),
.export-db-compact-table th:nth-child(10),
.export-db-compact-table td:nth-child(10){
  width: 78px;
  text-align: right;
  white-space: nowrap;
}
.export-db-compact-table .export-status{
  min-width: 24px;
  height: 24px;
  padding: 0;
  justify-content: center;
  font-size: 15px;
}
.export-db-compact-table .product-code{
  font-size: 12px;
}
.export-db-compact-table .date-cell{
  font-size: 11px;
}
.export-db-table thead th{
  position: sticky;
  top: 0;
  z-index: 2;
}
@media(max-width: 1100px){
  .export-db-compact-table{
    table-layout: auto;
  }
}


/* v162 readable Export BAZA - poprawka czytelności */
.export-db-compact-table{
  table-layout: fixed !important;
  width:100%;
  font-size:12px;
  border-collapse:collapse;
}
.export-db-compact-table th,
.export-db-compact-table td{
  padding:8px 7px !important;
  vertical-align:middle;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.export-db-compact-table .col-check{width:32px;text-align:center;}
.export-db-compact-table .col-status{width:34px;text-align:center;}
.export-db-compact-table .col-date{width:76px;}
.export-db-compact-table .col-invoice{width:118px;}
.export-db-compact-table .col-contractor{width:150px;}
.export-db-compact-table .col-sku{width:76px;}
.export-db-compact-table .col-name{width:auto;min-width:240px;}
.export-db-compact-table .col-qty{width:54px;text-align:center;}
.export-db-compact-table .col-money{width:72px;text-align:right;}
.export-db-compact-table .col-missing{width:150px;}

.export-db-not_ready .col-date{width:74px;}
.export-db-not_ready .col-invoice{width:112px;}
.export-db-not_ready .col-contractor{width:142px;}
.export-db-not_ready .col-sku{width:66px;}
.export-db-not_ready .col-name{min-width:210px;}
.export-db-not_ready .col-money{width:68px;}
.export-db-not_ready .col-missing{width:165px;}

.export-db-compact-table .export-status{
  min-width:22px!important;
  width:22px;
  height:22px!important;
  padding:0!important;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:14px!important;
}
.export-db-compact-table .missing-info{
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.export-db-compact-table .product-code,
.export-db-compact-table .col-invoice strong,
.export-db-compact-table .col-name strong{
  font-size:12px;
}
.export-db-compact-table .date-cell{
  font-size:11px;
}
.export-db-compact-table input[type="checkbox"]{
  width:18px;
  height:18px;
}
.export-db-table thead th{
  position:sticky;
  top:0;
  z-index:3;
  background:#f7f7f7;
}
@media(max-width:1200px){
  .export-db-compact-table{
    font-size:11.5px;
  }
  .export-db-compact-table th,
  .export-db-compact-table td{
    padding:7px 5px!important;
  }
  .export-db-compact-table .col-contractor{width:125px;}
  .export-db-compact-table .col-invoice{width:105px;}
  .export-db-compact-table .col-name{min-width:190px;}
}


/* v163 readable Export BAZA final */
.export-db-compact-table{
  font-size:14px!important;
  line-height:1.25;
}
.export-db-compact-table th{
  font-size:13px!important;
  font-weight:900;
}
.export-db-compact-table th,
.export-db-compact-table td{
  padding:9px 8px!important;
}
.export-db-compact-table .col-status{
  width:46px!important;
  text-align:center;
}
.export-db-compact-table .col-date{
  width:84px!important;
}
.export-db-compact-table .col-invoice{
  width:124px!important;
}
.export-db-compact-table .col-contractor{
  width:112px!important;
}
.export-db-compact-table .col-sku{
  width:76px!important;
}
.export-db-compact-table .col-name{
  min-width:180px!important;
  width:auto!important;
}
.export-db-compact-table .col-qty{
  width:58px!important;
}
.export-db-compact-table .col-money{
  width:82px!important;
}
.export-db-compact-table .export-status{
  min-width:32px!important;
  width:32px!important;
  height:32px!important;
  font-size:18px!important;
  font-weight:950!important;
  box-shadow:0 2px 6px rgba(0,0,0,.12);
}
.export-db-compact-table .product-code{
  font-size:14px!important;
  font-weight:900;
}
.export-db-compact-table .col-name strong{
  font-size:14px!important;
  font-weight:900;
}
.export-db-compact-table .col-invoice strong{
  font-size:14px!important;
  font-weight:900;
}
.export-db-compact-table .col-contractor{
  font-size:12px!important;
}
.export-db-compact-table .date-cell{
  font-size:12px!important;
  white-space:nowrap;
}

/* Niegotowe - osobny, czytelniejszy układ */
.export-db-not_ready{
  font-size:13.5px!important;
}
.export-db-not_ready .col-status{
  width:44px!important;
}
.export-db-not_ready .col-date{
  width:82px!important;
}
.export-db-not_ready .col-invoice{
  width:112px!important;
}
.export-db-not_ready .col-contractor{
  width:105px!important;
}
.export-db-not_ready .col-sku{
  width:62px!important;
}
.export-db-not_ready .col-name{
  min-width:160px!important;
}
.export-db-not_ready .col-qty{
  width:50px!important;
}
.export-db-not_ready .col-money{
  width:72px!important;
}
.export-db-not_ready .col-missing{
  width:220px!important;
  white-space:normal!important;
}
.missing-badges{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  align-items:center;
}
.missing-badge{
  display:inline-flex;
  align-items:center;
  padding:5px 7px;
  border-radius:999px;
  background:#ffe0e0;
  color:#9b0000;
  font-size:11px;
  font-weight:900;
  white-space:nowrap;
}
.export-db-not_ready .col-missing .missing-info{
  white-space:normal!important;
}
.export-db-not_ready .col-name strong{
  font-size:13.5px!important;
}
.export-db-not_ready .col-contractor,
.export-db-not_ready .date-cell{
  font-size:11.5px!important;
}

@media(max-width:1280px){
  .export-db-compact-table{
    font-size:13px!important;
  }
  .export-db-compact-table th,
  .export-db-compact-table td{
    padding:8px 6px!important;
  }
  .export-db-compact-table .col-contractor{
    width:96px!important;
  }
  .export-db-compact-table .col-name{
    min-width:150px!important;
  }
  .export-db-not_ready .col-missing{
    width:190px!important;
  }
}


/* v164 Export BAZA - live-fit: wszystko ma być widoczne i bez nachodzenia */
.export-db-compact-table{
  table-layout: fixed!important;
  width:100%!important;
  font-size:12px!important;
  line-height:1.2!important;
}
.export-db-compact-table th,
.export-db-compact-table td{
  padding:7px 5px!important;
  vertical-align:middle!important;
  overflow:hidden!important;
  text-overflow:clip!important;
  white-space:nowrap!important;
}
.export-db-compact-table th{
  font-size:12px!important;
  font-weight:900!important;
}
.export-db-compact-table .col-check{width:30px!important;text-align:center!important;}
.export-db-compact-table .col-status{width:62px!important;text-align:center!important;}
.export-db-compact-table .col-date{width:74px!important;}
.export-db-compact-table .col-invoice{width:130px!important;}
.export-db-compact-table .col-contractor{width:190px!important;}
.export-db-compact-table .col-sku{width:76px!important;}
.export-db-compact-table .col-name{width:auto!important;min-width:130px!important;}
.export-db-compact-table .col-qty{width:48px!important;text-align:center!important;}
.export-db-compact-table .col-money{width:68px!important;text-align:right!important;}

.export-db-compact-table .col-invoice,
.export-db-compact-table .col-contractor,
.export-db-compact-table .col-sku{
  text-overflow:clip!important;
}

.export-db-compact-table .col-name{
  text-overflow:ellipsis!important;
}

.export-db-compact-table .col-invoice strong,
.export-db-compact-table .product-code{
  font-size:12px!important;
  font-weight:950!important;
  color:#10253B!important;
}
.export-db-compact-table .col-name strong{
  font-size:12px!important;
  font-weight:900!important;
  color:#10253B!important;
}
.export-db-compact-table .col-contractor{
  font-size:11.5px!important;
}
.export-db-compact-table .date-cell{
  font-size:11.5px!important;
}
.export-db-compact-table .col-money,
.export-db-compact-table .col-qty{
  font-size:12px!important;
}

.export-db-compact-table .export-status{
  min-width:48px!important;
  width:auto!important;
  height:26px!important;
  padding:0 8px!important;
  border-radius:999px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:11px!important;
  font-weight:950!important;
  letter-spacing:.2px;
  box-shadow:none!important;
}
.export-db-compact-table .export-status.exported{
  background:#ddf7df!important;
  color:#137a13!important;
}
.export-db-compact-table .export-status.not-exported{
  background:#fff0c2!important;
  color:#7a4b00!important;
}
.export-db-compact-table .export-status.missing{
  background:#ffe0e0!important;
  color:#9b0000!important;
}

/* Niegotowe - więcej miejsca dla faktury/kontrahenta, krótkie badge */
.export-db-not_ready .col-status{width:58px!important;}
.export-db-not_ready .col-date{width:74px!important;}
.export-db-not_ready .col-invoice{width:140px!important;}
.export-db-not_ready .col-contractor{width:205px!important;}
.export-db-not_ready .col-sku{width:58px!important;}
.export-db-not_ready .col-name{width:auto!important;min-width:115px!important;}
.export-db-not_ready .col-qty{width:44px!important;}
.export-db-not_ready .col-money{width:64px!important;}
.export-db-not_ready .col-missing{width:108px!important;white-space:normal!important;}

.export-db-not_ready .col-missing,
.export-db-not_ready .col-missing *{
  overflow:visible!important;
  text-overflow:clip!important;
}
.export-db-not_ready .missing-badges{
  display:flex!important;
  flex-wrap:wrap!important;
  gap:4px!important;
}
.export-db-not_ready .missing-badge{
  padding:4px 6px!important;
  border-radius:999px!important;
  background:#ffe0e0!important;
  color:#9b0000!important;
  font-size:10px!important;
  font-weight:950!important;
  white-space:nowrap!important;
}

/* table header */
.export-db-table thead th{
  position:sticky!important;
  top:0!important;
  z-index:3!important;
  background:#f1f3f5!important;
}

/* jeżeli ekran jest trochę mniejszy, minimalnie ścieśniamy */
@media(max-width:1280px){
  .export-db-compact-table{
    font-size:11px!important;
  }
  .export-db-compact-table th,
  .export-db-compact-table td{
    padding:6px 4px!important;
  }
  .export-db-compact-table .col-contractor{width:165px!important;}
  .export-db-compact-table .col-invoice{width:116px!important;}
  .export-db-compact-table .col-status{width:56px!important;}
  .export-db-compact-table .export-status{
    min-width:42px!important;
    font-size:10px!important;
  }
  .export-db-not_ready .col-contractor{width:175px!important;}
  .export-db-not_ready .col-invoice{width:120px!important;}
  .export-db-not_ready .col-missing{width:96px!important;}
}


/* v165 Export BAZA - Produkty nieuzupełnione */
.unassigned-products-table{
  width:100%;
  table-layout:fixed;
}
.unassigned-products-table th,
.unassigned-products-table td{
  padding:10px 9px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.unassigned-products-table th:nth-child(1),
.unassigned-products-table td:nth-child(1){width:110px;}
.unassigned-products-table th:nth-child(2),
.unassigned-products-table td:nth-child(2){width:auto;}
.unassigned-products-table th:nth-child(3),
.unassigned-products-table td:nth-child(3){width:80px;text-align:center;}
.unassigned-products-table th:nth-child(4),
.unassigned-products-table td:nth-child(4),
.unassigned-products-table th:nth-child(5),
.unassigned-products-table td:nth-child(5){width:120px;text-align:right;}
.unassigned-products-table th:nth-child(6),
.unassigned-products-table td:nth-child(6){width:150px;}


/* v166 Historia działań w ustawieniach */
.settings-history-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin:10px 0 12px;
  color:#555;
  font-size:14px;
}
.settings-history-table th,
.settings-history-table td{
  font-size:13px;
  vertical-align:top;
}
.settings-history-table th:nth-child(1),
.settings-history-table td:nth-child(1){
  width:150px;
  white-space:nowrap;
}
.settings-history-table th:nth-child(2),
.settings-history-table td:nth-child(2){
  width:42px;
  text-align:center;
}
.settings-history-table th:nth-child(3),
.settings-history-table td:nth-child(3){
  width:110px;
}
.settings-history-table th:nth-child(4),
.settings-history-table td:nth-child(4){
  width:170px;
}
.settings-history-table th:nth-child(5),
.settings-history-table td:nth-child(5){
  width:130px;
}
.settings-history-pagination{
  margin-top:14px;
}

/* v168 Export faktur - Zmiany po przyjęciu */
.invoice-export-table td,
.invoice-export-table th{
  vertical-align:middle;
}
.export-tabs-card{
  margin-bottom:12px;
}

/* v169 Export wybranych zmian po przyjęciu */
.invoice-export-checkbox{
  width:18px;
  height:18px;
}

/* v170 status zmian po przyjęciu */
.invoice-export-table .status-pill{
  white-space:nowrap;
}
