/* NARUM B2B — wspólny system wizualny klienta i administracji */
:root{
  --narum-900:#0e3027;--narum-800:#153f32;--narum-700:#15513e;
  --narum-600:#17664d;--narum-500:#297457;--narum-100:#e7f3ee;
  --surface:#fff;--canvas:#f5f7fa;--canvas-admin:#f4f7f8;
  --text:#102035;--muted:#687586;--line:#dce5e2;--danger:#b42318;
  --radius-sm:9px;--radius-md:12px;--radius-lg:18px;
  --control-height:46px;--shadow-modal:0 25px 80px rgba(5,25,20,.34);
  --font-ui:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
}
html,body,button,input,select,textarea{font-family:var(--font-ui)}
body{color:var(--text)}
button,input,select,textarea{font:inherit}
button{border-radius:var(--radius-sm);transition:background-color .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease}
button:not(:disabled){cursor:pointer}
button:disabled{opacity:.52;cursor:not-allowed;filter:saturate(.7)}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,a:focus-visible{outline:3px solid rgba(41,116,87,.25);outline-offset:2px}
input:not([type=checkbox]):not([type=radio]),select{min-height:var(--control-height);border:1px solid #cbd9d4;border-radius:10px;background:var(--surface)}
textarea{border:1px solid #cbd9d4;border-radius:10px;background:var(--surface)}
input:hover,select:hover,textarea:hover{border-color:#9fb8ae}
input:focus,select:focus,textarea:focus{border-color:#39866c;box-shadow:0 0 0 3px rgba(57,134,108,.13)}

/* Ekrany logowania */
.login-shell,.login{background:radial-gradient(circle at 20% 0,#e7f4ee,transparent 40%),#f8faf9}
.login-card,.login form{width:min(430px,calc(100vw - 32px));min-height:500px;padding:38px;border:1px solid var(--line);border-radius:var(--radius-lg);box-shadow:0 20px 60px rgba(23,63,48,.13)}
.login-card .brand-logo img,.login img{width:190px;max-width:100%;height:auto}
.login-card h1,.login h1{margin:18px 0 5px;font-size:32px;line-height:1.18;letter-spacing:-.02em}
.login-card input,.login input{height:var(--control-height)}
.login-card form button,.login form>button{height:var(--control-height);padding:0 17px;background:var(--narum-700);color:#fff;font-weight:750}
.login-card form button:hover,.login form>button:hover{background:var(--narum-900);box-shadow:0 5px 14px rgba(14,48,39,.17);transform:translateY(-1px)}
body.auth-pending #admin-panel,body.auth-pending dialog,body.auth-pending .stats-filters{display:none!important}
body.auth-pending::before,body.auth-pending::after{content:none!important}

/* Nawigacja i podstawowe powierzchnie */
.app>aside,.shell aside{background:var(--narum-900)}
nav a,.shell nav a{border-radius:var(--radius-sm);transition:background-color .16s ease,color .16s ease}
nav a.active,nav a:hover,.shell nav a.active,.shell nav a:hover{background:#204f43;color:#fff}
.cards article,.catalog,.cart,.stats article,.table-card,.promotion-card,.detail-box{border-color:var(--line);border-radius:var(--radius-md);background:var(--surface)}
.account button,.shell aside>button{min-height:44px;background:#204f43;color:#fff;text-align:center}
.account button:hover,.shell aside>button:hover{background:#2b6555;box-shadow:0 5px 14px rgba(0,0,0,.15);transform:translateY(-1px)}

/* Wspólne przyciski */
form button[type=submit],#add-contractor,#save-contractor,#add-promotion,.order-as,.checkout-toggle,.delivery-actions button[type=submit],.detail-title-actions button{min-height:44px;background:var(--narum-700);color:#fff;font-weight:750}
form button[type=submit]:hover,#add-contractor:hover,#save-contractor:hover,#add-promotion:hover,.order-as:hover,.checkout-toggle:hover,.delivery-actions button[type=submit]:hover,.detail-title-actions button:hover{background:var(--narum-900);box-shadow:0 4px 12px rgba(16,48,39,.16);transform:translateY(-1px)}
.secondary,.delivery-actions .secondary{min-height:44px;background:#edf2f0;color:#244b3f}
.secondary:hover,.delivery-actions .secondary:hover{background:#dde9e4}
.danger,.promotion-actions button.danger{color:var(--danger);background:#fff;border-color:#efc7c2}
.danger:hover,.promotion-actions button.danger:hover{background:var(--danger);border-color:var(--danger);color:#fff}
.icon,.delivery-close,.order-confirmation>#confirmation-close,.order-close.icon{display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;min-height:40px;padding:0;border:1px solid var(--line);border-radius:10px;background:#f0f3f2;color:#233b33;font-size:24px;line-height:1}
.icon:hover,.delivery-close:hover,.order-confirmation>#confirmation-close:hover,.order-close.icon:hover{background:#e2e9e6;border-color:#b9cdc5;transform:rotate(3deg)}

/* Modale */
dialog,.delivery-modal,.order-confirmation{border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow-modal)}
dialog::backdrop{background:rgba(5,25,20,.52)}
.modal-head,.delivery-heading,.order-detail-head{align-items:flex-start;padding-bottom:16px;border-bottom:1px solid #e1e9e6}
.modal-head h2,.delivery-heading h3,.order-detail-head h2{font-size:24px;line-height:1.2;letter-spacing:-.015em}
.modal-actions,.delivery-actions,.confirmation-actions{gap:10px}
.modal-actions button,.delivery-actions button,.confirmation-actions button{min-height:44px}

/* Czytelność danych */
.product h3,.company strong{font-weight:700;line-height:1.3}
.product small,.cart-row small,.company small,.location small,.order-date,.order-count{font-size:11px;line-height:1.4;color:#718079}
.product-price small,.cart-net,.cart-total small,.delivery-totals small{font-size:11px!important}
.status,.promotion-state,.dev-badge{border-radius:999px;font-size:11px;font-weight:750}

/* Kategorie i układy responsywne */
@media(max-width:1100px){.category-tabs{grid-template-columns:repeat(3,1fr)}.header-actions{flex-wrap:wrap}.header-actions input{flex:1 1 260px}}
@media(max-width:800px){
  .shell{grid-template-columns:1fr}.shell aside{position:relative;height:auto;display:grid;grid-template-columns:1fr auto;gap:10px 18px;padding:18px}.shell aside img{width:140px}.shell aside p{grid-column:1;margin:0}.shell aside nav{grid-column:1/-1;display:flex;gap:6px;overflow-x:auto;margin:4px 0}.shell aside nav a{flex:0 0 auto;white-space:nowrap}.shell aside>button{grid-column:2;grid-row:1;margin:0;padding:0 15px}.content{padding:20px 16px}.content header{align-items:stretch}.header-actions{width:100%}.header-actions>*{width:100%!important}.stats{grid-template-columns:1fr}.promotion-card-head{display:grid}.promotion-actions{width:100%}.promotion-actions button{flex:1}.promotion-card dl,.promotion-usage{grid-template-columns:1fr 1fr}
}
@media(max-width:600px){
  .login-card,.login form{min-height:0;padding:28px 24px}.login-card .brand-logo img,.login img{width:175px}.login-card h1,.login h1{font-size:27px}.category-tabs{grid-template-columns:1fr 1fr}.cards{grid-template-columns:1fr}.delivery-modal,.order-confirmation,dialog{width:calc(100vw - 20px);max-height:calc(100vh - 20px)}.modal-actions,.delivery-actions,.confirmation-actions{display:grid;grid-template-columns:1fr}.promotion-card dl,.promotion-usage{grid-template-columns:1fr}.choice-grid{grid-template-columns:1fr}
}


/* Koszyk: panel promocji i podsumowanie przypięte do dolnej krawędzi */
.cart #cart-items{flex:1 1 auto;max-height:none;min-height:0;overflow-y:auto}
.cart #promotion-status{flex:0 0 auto;margin-top:12px;margin-bottom:2px}
.cart .cart-total{flex:0 0 auto;margin-top:12px}
@media(max-width:900px){.cart #cart-items{flex:0 1 auto;max-height:420px}.cart #promotion-status{margin-top:12px}}
