:root { --blue:#003f78; --soft:#eaf5fb; --bg:#f5f6f9; --text:#101828; --muted:#667085; --border:#e4e7ec; }
*{box-sizing:border-box} body{margin:0;background:var(--bg);font-family:Arial,sans-serif;color:var(--text)}
.portal-header{display:flex;justify-content:space-between;align-items:center;padding:18px 28px;background:#fff;border-bottom:1px solid var(--border);position:sticky;top:0;z-index:10}
.portal-header div{display:flex;gap:18px;align-items:center}.portal-header nav{display:flex;gap:18px}.portal-header a{color:var(--blue);text-decoration:none;font-weight:600}
.portal-main{padding:24px 32px}.filterbar{display:flex;gap:12px;align-items:center;margin-bottom:24px}.filterbar input{flex:1;max-width:520px;padding:13px 15px;border:1px solid var(--border);border-radius:10px}.filterbar button,.add-form button,.primary{background:var(--blue);color:white;border:0;border-radius:10px;padding:12px 16px;font-weight:700;cursor:pointer}.count{margin-left:auto;color:var(--muted)}
.product-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:16px}.product-card{background:#fff;border-radius:8px;padding:16px;min-height:490px;display:flex;flex-direction:column;box-shadow:0 1px 2px rgba(16,24,40,.04)}
.image-wrap{height:190px;display:flex;align-items:center;justify-content:center;margin-bottom:12px}.image-wrap img{max-width:100%;max-height:180px;object-fit:contain}.no-image{height:150px;width:100%;display:flex;align-items:center;justify-content:center;background:#f2f4f7;color:var(--muted);border-radius:8px}.brand{font-size:13px;color:var(--muted);font-weight:700;text-transform:uppercase}.product-card h2{font-size:17px;line-height:1.35;margin:8px 0}.artno{font-size:14px;margin-bottom:8px}.desc{font-size:14px;line-height:1.45;min-height:60px;margin:0 0 10px}.stock{font-size:14px;font-weight:700;margin-top:auto}.stock.in{color:#027a48}.stock.out{color:#b42318}.prices{display:flex;flex-direction:column;gap:3px;margin:10px 0}.prices span{color:var(--muted);font-size:14px}.prices strong{font-size:18px;color:var(--blue)}.add-form{display:grid;grid-template-columns:82px 1fr;gap:8px}.add-form input{padding:11px;border:1px solid var(--border);border-radius:10px}.panel{background:#fff;border-radius:10px;padding:20px;max-width:900px}.table{width:100%;border-collapse:collapse;background:#fff}.table th,.table td{padding:12px;border-bottom:1px solid var(--border);text-align:left}.form-stack{display:grid;gap:12px;max-width:520px}.form-stack input,.form-stack textarea,.form-stack select{padding:12px;border:1px solid var(--border);border-radius:10px}.muted{color:var(--muted)}
.portal-header a.active{border-bottom:2px solid var(--blue);padding-bottom:3px}.wide-panel{max-width:1200px}.button-link{display:inline-block;background:var(--blue);color:#fff!important;text-decoration:none;border-radius:8px;padding:8px 12px;font-weight:700}.status-pill{display:inline-block;border-radius:999px;padding:4px 9px;font-size:12px;font-weight:700;background:#eef2ff;color:#3538cd}.status-new{background:#fff7ed;color:#c2410c}.status-reviewing{background:#eff8ff;color:#175cd3}.status-converted{background:#ecfdf3;color:#027a48}.status-rejected{background:#fef3f2;color:#b42318}
.unit{font-size:13px;color:#475569;margin-top:4px}
.qty-stepper{display:inline-flex;align-items:center;gap:4px;margin-right:8px}
.qty-stepper input{width:64px;text-align:center}
.qty-btn{width:32px;height:32px;border:1px solid #cbd5e1;background:#fff;border-radius:6px;cursor:pointer;font-weight:700}
.qty-btn:hover{background:#f1f5f9}


/* v52: quantity stepper horizontal layout */
.add-form{
  display:grid;
  grid-template-columns:max-content 1fr;
  align-items:stretch;
  gap:10px;
}
.qty-stepper{
  display:grid !important;
  grid-template-columns:36px 52px 36px;
  align-items:stretch;
  gap:0;
  width:max-content;
  margin-right:0;
}
.qty-stepper input{
  width:52px !important;
  min-width:52px;
  height:40px;
  text-align:center;
  border-radius:0 !important;
  border-left:0 !important;
  border-right:0 !important;
  padding:0 !important;
  -moz-appearance:textfield;
}
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}
.qty-btn{
  width:36px !important;
  height:40px !important;
  border:1px solid #cbd5e1;
  background:#fff;
  color:var(--blue);
  cursor:pointer;
  font-weight:700;
  line-height:1;
}
.qty-btn:first-child{border-radius:10px 0 0 10px;}
.qty-btn:last-child{border-radius:0 10px 10px 0;}
.add-form > button{
  min-height:40px;
}

/* v53: use native number spinner in input */
.add-form{display:grid;grid-template-columns:82px 1fr;align-items:stretch;gap:8px;}
.add-form .qty-input{width:82px;min-width:82px;height:42px;text-align:center;padding:11px;border:1px solid var(--border);border-radius:10px;-moz-appearance:auto;appearance:auto;}
.add-form .qty-input::-webkit-outer-spin-button,.add-form .qty-input::-webkit-inner-spin-button{-webkit-appearance:auto;margin:0;}
.qty-stepper,.qty-btn{display:none!important;}
.add-form > button{min-height:42px;}

/* v55: company label, auth style, and delivery-address modal */
.portal-title{display:flex;flex-direction:column;gap:3px;align-items:flex-start!important}
.portal-company{font-size:13px;color:var(--muted);font-weight:500}
.auth-main{display:flex;justify-content:center;align-items:flex-start;min-height:calc(100vh - 80px)}
.auth-panel{width:100%;max-width:520px;margin-top:42px;box-shadow:0 1px 3px rgba(16,24,40,.08)}
.auth-panel h1{margin-top:0}.auth-links a{color:var(--blue);font-weight:700}.alert{padding:11px 13px;border-radius:10px;background:#eff8ff;color:#175cd3;margin:12px 0}.alert.error{background:#fef3f2;color:#b42318}
.form-stack label{font-weight:700;font-size:14px}.form-stack label input,.form-stack label select{display:block;width:100%;margin-top:5px;font-weight:400}.secondary{background:#fff;color:var(--blue);border:1px solid var(--blue);border-radius:10px;padding:11px 14px;font-weight:700;cursor:pointer}.delivery-card{border:1px solid var(--border);border-radius:10px;padding:14px;margin:12px 0}.delivery-card h2{margin-top:0;font-size:18px}.delivery-select-row{display:grid;grid-template-columns:minmax(240px,1fr) auto;gap:10px;align-items:end;max-width:760px}.delivery-select-row select{width:100%;padding:12px;border:1px solid var(--border);border-radius:10px}.modal-backdrop{position:fixed;inset:0;background:rgba(16,24,40,.55);z-index:1000;display:flex;align-items:center;justify-content:center;padding:20px}.modal-backdrop[hidden]{display:none}.modal{background:#fff;border-radius:14px;width:min(620px,100%);box-shadow:0 20px 60px rgba(16,24,40,.25);padding:20px}.modal-header{display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--border);padding-bottom:12px;margin-bottom:14px}.modal-header h2{margin:0;font-size:22px}.icon-button{border:0;background:#f2f4f7;border-radius:999px;width:34px;height:34px;font-size:24px;line-height:1;cursor:pointer}.swedish-address-form{max-width:none}.address-grid{display:grid;grid-template-columns:150px 1fr;gap:12px}.optional{color:var(--muted);font-weight:400}.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:6px}.modal-message{color:#b42318;font-weight:700;min-height:20px}@media (max-width:640px){.portal-header{align-items:flex-start;flex-direction:column;gap:12px}.portal-header nav{flex-wrap:wrap}.delivery-select-row{grid-template-columns:1fr}.address-grid{grid-template-columns:1fr}.modal{max-height:90vh;overflow:auto}}

/* v56: snyggare tabellformulär och robust adress-popup */
.table-form{max-width:760px;width:100%;}
.table-form table{width:100%;border-collapse:separate;border-spacing:0 10px;}
.table-form th{width:190px;text-align:left;vertical-align:top;padding:12px 12px 0 0;color:#344054;font-size:14px;}
.table-form td{vertical-align:top;padding:0;}
.table-form input,.table-form select,.table-form textarea{width:100%;padding:12px;border:1px solid var(--border);border-radius:10px;background:#fff;}
.table-form .field-help{font-size:12px;color:var(--muted);margin-top:5px;}
.auth-table-form{margin-top:16px;}
.auth-table-form th{width:140px;}
.auth-panel{max-width:640px;}
.auth-links{display:flex;gap:6px;align-items:center;flex-wrap:wrap;}
.modal-backdrop{display:none;}
.modal-backdrop.is-open{display:flex;}
.modal-backdrop[hidden]{display:none!important;}
.modal .table-form{max-width:none;}
.modal .table-form th{width:170px;}
.modal-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:0;}
.modal-message{margin-top:10px;color:#027a48;font-weight:700;min-height:20px;}
.modal-message.error{color:#b42318;}
@media (max-width:640px){.table-form table,.table-form tbody,.table-form tr,.table-form th,.table-form td{display:block;width:100%;}.table-form th{padding:0 0 5px 0}.table-form tr{margin-bottom:12px}.modal .table-form th{width:100%;}.modal-actions{justify-content:stretch;flex-direction:column}.modal-actions button{width:100%;}}
