/* ===== B2B Portal — stilovi ===================================== */
:root{
  --akcent:#0891b2;
  --tekst:#0f172a;
  --muted:#64748b;
  --linija:#e2e8f0;
  --pozadina:#f1f5f9;
  --bijela:#ffffff;
  --ok:#059669;
  --greska:#dc2626;
  --radius:14px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,Arial,sans-serif;
  color:var(--tekst); background:var(--pozadina); -webkit-font-smoothing:antialiased;
}

/* ---------- AUTH (login / lozinka) ---------- */
.b2b-auth-body{
  min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--akcent) 16%, transparent), transparent 60%),
    var(--pozadina);
}
.auth-card{
  width:100%; max-width:400px; background:var(--bijela); border:1px solid var(--linija);
  border-radius:var(--radius); padding:32px 28px; box-shadow:0 12px 40px rgba(15,23,42,.08);
}
.auth-brand{display:flex; align-items:center; gap:14px; margin-bottom:22px}
.auth-mark{
  width:46px; height:46px; border-radius:12px; flex:0 0 auto;
  background:var(--akcent); color:#fff; font-weight:800; font-size:22px;
  display:flex; align-items:center; justify-content:center; letter-spacing:.5px;
}
.auth-title{font-size:18px; font-weight:700; line-height:1.1}
.auth-sub{font-size:13px; color:var(--muted); margin-top:2px}
.auth-form{display:flex; flex-direction:column}
.auth-label{font-size:13px; font-weight:600; color:#334155; margin:14px 0 6px}
.auth-hint{font-weight:400; color:var(--muted)}
.auth-input{
  height:44px; padding:0 13px; border:1px solid var(--linija); border-radius:10px;
  font-size:15px; background:#fff; transition:border-color .15s, box-shadow .15s; width:100%;
}
.auth-input:focus{outline:none; border-color:var(--akcent); box-shadow:0 0 0 3px color-mix(in srgb, var(--akcent) 22%, transparent)}
.auth-btn{
  margin-top:22px; height:46px; border:none; border-radius:10px; cursor:pointer;
  background:var(--akcent); color:#fff; font-size:15px; font-weight:700; width:100%;
  display:flex; align-items:center; justify-content:center; text-decoration:none;
  transition:filter .15s;
}
.auth-btn:hover{filter:brightness(1.06)}
.auth-btn:focus-visible{outline:3px solid color-mix(in srgb, var(--akcent) 40%, transparent); outline-offset:2px}
.auth-greska{background:#fef2f2; color:var(--greska); border:1px solid #fecaca; border-radius:10px; padding:11px 13px; font-size:14px; margin-bottom:6px}
.auth-info{background:#ecfeff; color:#0e7490; border:1px solid #a5f3fc; border-radius:10px; padding:11px 13px; font-size:14px; margin-bottom:14px}
.auth-ok{background:#ecfdf5; color:var(--ok); border:1px solid #a7f3d0; border-radius:10px; padding:11px 13px; font-size:14px; margin-bottom:14px}
.auth-foot{margin-top:18px; text-align:center; font-size:13px; color:var(--muted)}
.auth-foot a{color:var(--akcent); text-decoration:none}

/* ---------- LANDING ---------- */
.b2b-top{background:#0b1220; color:#fff}
.b2b-top-inner{max-width:980px; margin:0 auto; padding:13px 20px; display:flex; align-items:center; justify-content:space-between; gap:12px}
.b2b-brand{font-weight:700; font-size:16px; display:flex; align-items:center; gap:9px}
.b2b-mark{width:28px; height:28px; border-radius:8px; background:var(--akcent); color:#fff; font-weight:800; display:inline-flex; align-items:center; justify-content:center; font-size:15px}
.b2b-user{display:flex; align-items:center; gap:12px; font-size:14px; flex-wrap:wrap}
.b2b-firma{color:#cbd5e1; max-width:240px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.b2b-ghost{color:#fff; text-decoration:none; border:1px solid rgba(255,255,255,.22); padding:5px 11px; border-radius:8px; font-size:13px}
.b2b-ghost:hover{background:rgba(255,255,255,.1)}

.b2b-main{max-width:980px; margin:0 auto; padding:24px 20px 60px; display:flex; flex-direction:column; gap:18px}
.b2b-card{background:var(--bijela); border:1px solid var(--linija); border-radius:var(--radius); padding:22px 22px}
.b2b-h1{margin:0 0 4px; font-size:22px}
.b2b-h2{margin:0 0 4px; font-size:17px}
.b2b-lead{margin:0 0 16px; color:#334155}
.b2b-muted{color:var(--muted); font-size:14px; margin:2px 0 12px}
.b2b-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px}
.b2b-fact{background:var(--pozadina); border-radius:10px; padding:12px 14px}
.b2b-fact-k{font-size:12px; color:var(--muted); text-transform:uppercase; letter-spacing:.4px}
.b2b-fact-v{font-size:16px; font-weight:700; margin-top:3px; word-break:break-word}

.b2b-search{width:100%; height:46px; padding:0 14px; border:1px solid var(--linija); border-radius:10px; font-size:15px}
.b2b-search:focus{outline:none; border-color:var(--akcent); box-shadow:0 0 0 3px color-mix(in srgb, var(--akcent) 22%, transparent)}
.b2b-rez{margin-top:14px; display:flex; flex-direction:column; gap:8px}
.b2b-row{display:flex; align-items:center; gap:12px; padding:11px 13px; border:1px solid var(--linija); border-radius:10px}
.b2b-row-naziv{font-weight:600; font-size:14px}
.b2b-row-meta{font-size:12px; color:var(--muted); margin-top:2px}
.b2b-row-cijena{margin-left:auto; text-align:right; flex:0 0 auto}
.b2b-cijena-v{font-weight:800; font-size:16px; color:var(--tekst)}
.b2b-cijena-vpc{font-size:12px; color:var(--muted); text-decoration:line-through}
.b2b-tag{display:inline-block; font-size:11px; font-weight:700; padding:2px 7px; border-radius:6px; margin-top:3px}
.b2b-tag.special{background:#ecfeff; color:#0e7490}
.b2b-tag.rabat{background:#fef9c3; color:#854d0e}
.b2b-prazno{color:var(--muted); font-size:14px; padding:8px 2px}

/* ===== STOREFRONT ============================================== */
.b2b-nav{display:flex; gap:4px; flex:1; justify-content:center}
.b2b-tab{background:none; border:none; color:#cbd5e1; font-size:14px; font-weight:600; padding:7px 14px; border-radius:8px; cursor:pointer; position:relative}
.b2b-tab:hover{background:rgba(255,255,255,.08); color:#fff}
.b2b-tab.akt{background:var(--akcent); color:#fff}
.b2b-badge{display:inline-flex; min-width:18px; height:18px; padding:0 5px; align-items:center; justify-content:center; background:#fff; color:var(--akcent); border-radius:999px; font-size:11px; font-weight:800; margin-left:4px}
.b2b-tab.akt .b2b-badge{background:#0b1220; color:#fff}

.b2b-spinner-wrap{display:flex; justify-content:center; padding:60px}
.b2b-spinner{width:32px; height:32px; border:3px solid var(--linija); border-top-color:var(--akcent); border-radius:50%; animation:b2bspin .8s linear infinite}
@keyframes b2bspin{to{transform:rotate(360deg)}}

/* katalog bar */
.b2b-kat-bar{display:flex; flex-direction:column; gap:10px; margin-bottom:12px}
.b2b-filteri{display:flex; gap:8px; flex-wrap:wrap; align-items:center}
.b2b-sel{height:38px; padding:0 10px; border:1px solid var(--linija); border-radius:9px; font-size:14px; background:#fff; max-width:220px}
.b2b-sel:focus{outline:none; border-color:var(--akcent)}
.b2b-chk{display:flex; align-items:center; gap:7px; font-size:14px; color:#334155}

/* katalog grid */
.b2b-grid-art{display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:14px; margin-top:6px}
.b2b-art{background:#fff; border:1px solid var(--linija); border-radius:12px; overflow:hidden; display:flex; flex-direction:column}
.b2b-art-img{aspect-ratio:1/1; background:#f8fafc; display:flex; align-items:center; justify-content:center; overflow:hidden}
.b2b-art-img img{width:100%; height:100%; object-fit:contain}
.b2b-art-body{padding:11px 12px 12px; display:flex; flex-direction:column; gap:4px; flex:1}
.b2b-art-naziv{font-weight:600; font-size:14px; line-height:1.25; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; min-height:35px}
.b2b-art-meta{font-size:12px; color:var(--muted); display:flex; gap:6px; align-items:center; flex-wrap:wrap}
.b2b-art-cijena{margin-top:auto; padding-top:6px; display:flex; align-items:center; gap:6px; flex-wrap:wrap}
.b2b-kc{font-weight:800; font-size:16px}
.b2b-vpc{font-size:12px; color:var(--muted); text-decoration:line-through}
.b2b-art-add{display:flex; gap:6px; margin-top:8px}
.b2b-qty{width:56px; height:36px; border:1px solid var(--linija); border-radius:8px; text-align:center; font-size:14px}
.b2b-qty:focus{outline:none; border-color:var(--akcent)}
.b2b-zal{font-size:11px; font-weight:700; padding:1px 7px; border-radius:6px}
.b2b-zal.ima{background:#ecfdf5; color:#059669}
.b2b-zal.nema{background:#f1f5f9; color:#64748b}
.b2b-tag{display:inline-block; font-size:11px; font-weight:700; padding:2px 7px; border-radius:6px}
.b2b-tag.special{background:#ecfeff; color:#0e7490}
.b2b-tag.rabat{background:#fef9c3; color:#854d0e}
.b2b-more{display:flex; justify-content:center; padding:18px 0}

/* gumbi */
.b2b-btn{height:42px; padding:0 16px; border:none; border-radius:9px; background:var(--akcent); color:#fff; font-weight:700; font-size:14px; cursor:pointer}
.b2b-btn:hover{filter:brightness(1.06)}
.b2b-btn:disabled{opacity:.6; cursor:default}
.b2b-btn.sek{background:#fff; color:var(--tekst); border:1px solid var(--linija)}
.b2b-btn.mali{height:36px; padding:0 12px; font-size:13px; flex:1}

/* košarica */
.b2b-kos-list{display:flex; flex-direction:column; gap:8px; margin:12px 0}
.b2b-kos-row{display:flex; align-items:center; gap:12px; padding:10px; border:1px solid var(--linija); border-radius:10px}
.b2b-kos-img{width:48px; height:48px; flex:0 0 auto; background:#f8fafc; border-radius:8px; overflow:hidden; display:flex; align-items:center; justify-content:center}
.b2b-kos-img img{width:100%; height:100%; object-fit:contain}
.b2b-kos-info{flex:1; min-width:0}
.b2b-kos-naziv{font-weight:600; font-size:14px}
.b2b-kos-meta{font-size:12px; color:var(--muted)}
.b2b-step{display:flex; align-items:center; gap:0; flex:0 0 auto}
.b2b-step-b{width:30px; height:34px; border:1px solid var(--linija); background:#fff; cursor:pointer; font-size:17px; line-height:1}
.b2b-step-b:first-child{border-radius:8px 0 0 8px}
.b2b-step-b:last-child{border-radius:0 8px 8px 0}
.b2b-step-i{width:48px; height:34px; border:1px solid var(--linija); border-left:none; border-right:none; text-align:center; font-size:14px}
.b2b-step-i:focus{outline:none}
.b2b-kos-vrij{font-weight:700; font-size:15px; min-width:90px; text-align:right; flex:0 0 auto}
.b2b-x{width:30px; height:30px; border:none; background:none; color:var(--muted); font-size:20px; cursor:pointer; flex:0 0 auto}
.b2b-x:hover{color:var(--greska)}
.b2b-kos-summa{border-top:1px solid var(--linija); margin-top:8px; padding-top:12px; display:flex; flex-direction:column; gap:6px; max-width:320px; margin-left:auto}
.b2b-summa-red{display:flex; justify-content:space-between; font-size:14px; color:#334155}
.b2b-summa-red.ukup{font-size:18px; font-weight:800; color:var(--tekst); border-top:1px solid var(--linija); padding-top:8px; margin-top:2px}
.b2b-label{display:block; font-size:13px; font-weight:600; color:#334155; margin:16px 0 6px}
.b2b-textarea{width:100%; border:1px solid var(--linija); border-radius:9px; padding:10px 12px; font-size:14px; font-family:inherit; resize:vertical}
.b2b-textarea:focus{outline:none; border-color:var(--akcent)}
.b2b-kos-akcije{display:flex; gap:10px; justify-content:flex-end; margin-top:16px; flex-wrap:wrap}

/* uspjeh */
.b2b-uspjeh{text-align:center}
.b2b-uspjeh-ikona{width:60px; height:60px; margin:6px auto 10px; border-radius:50%; background:#ecfdf5; color:#059669; font-size:32px; display:flex; align-items:center; justify-content:center; font-weight:800}

/* narudžbe */
.b2b-nar-list{display:flex; flex-direction:column; gap:8px; margin-top:12px}
.b2b-nar-row{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 14px; border:1px solid var(--linija); border-radius:10px; cursor:pointer}
.b2b-nar-row:hover{border-color:var(--akcent); background:#f8feff}
.b2b-nar-id{font-weight:700; font-size:14px}
.b2b-nar-meta{font-size:12px; color:var(--muted); margin-top:2px}
.b2b-nar-desno{display:flex; align-items:center; gap:12px}
.b2b-nar-iznos{font-weight:800; font-size:15px}
.b2b-stat{font-size:11px; font-weight:700; padding:3px 9px; border-radius:999px}
.b2b-stat.nacrt{background:#f1f5f9; color:#64748b}
.b2b-stat.poslano{background:#eff6ff; color:#2563eb}
.b2b-stat.ok{background:#ecfdf5; color:#059669}
.b2b-stat.greska{background:#fef2f2; color:#dc2626}

/* modal detalj */
.b2b-overlay{position:fixed; inset:0; background:rgba(15,23,42,.45); display:flex; align-items:center; justify-content:center; padding:16px; z-index:60}
.b2b-modal{width:100%; max-width:560px; background:#fff; border-radius:14px; max-height:92vh; overflow:auto; box-shadow:0 24px 60px rgba(15,23,42,.25)}
.b2b-modal-head{display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid var(--linija)}
.b2b-modal-title{font-size:16px; font-weight:700; display:flex; align-items:center; gap:10px}
.b2b-modal-body{padding:16px 20px}
.b2b-modal-foot{padding:14px 20px; border-top:1px solid var(--linija); display:flex; gap:10px; justify-content:flex-end}
.b2b-napomena{background:#f8fafc; border:1px solid var(--linija); border-radius:9px; padding:9px 12px; font-size:13px; margin-bottom:12px}
.b2b-det-list{display:flex; flex-direction:column; gap:8px}
.b2b-det-row{display:flex; align-items:center; gap:10px}
.b2b-det-img{width:40px; height:40px; flex:0 0 auto; background:#f8fafc; border-radius:7px; overflow:hidden; display:flex; align-items:center; justify-content:center}
.b2b-det-img img{width:100%; height:100%; object-fit:contain}
.b2b-det-info{flex:1; font-size:13px}
.b2b-det-vrij{font-weight:700; font-size:14px}

/* toast */
.b2b-toast{position:fixed; left:50%; bottom:24px; transform:translateX(-50%) translateY(10px); background:#0b1220; color:#fff; padding:11px 18px; border-radius:10px; font-size:14px; font-weight:600; opacity:0; transition:opacity .2s, transform .2s; z-index:80; box-shadow:0 10px 30px rgba(0,0,0,.25)}
.b2b-toast.show{opacity:1; transform:translateX(-50%) translateY(0)}

@media (max-width:640px){
  .b2b-top-inner{flex-wrap:wrap}
  .b2b-nav{order:3; width:100%; justify-content:space-between}
  .b2b-firma{max-width:120px}
  .b2b-kos-vrij{min-width:auto}
  .b2b-kos-row{flex-wrap:wrap}
}

/* ===== Kupljeno ranije ========================================= */
.b2b-kup-list{display:flex; flex-direction:column; gap:8px; margin-top:12px}
.b2b-kup-row{display:flex; align-items:center; gap:12px; padding:10px; border:1px solid var(--linija); border-radius:10px}
.b2b-kup-img{width:46px; height:46px; flex:0 0 auto; background:#f8fafc; border-radius:8px; overflow:hidden; display:flex; align-items:center; justify-content:center}
.b2b-kup-img img{width:100%; height:100%; object-fit:contain}
.b2b-kup-info{flex:1; min-width:0}
.b2b-kup-naziv{font-weight:600; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.b2b-kup-meta{font-size:12px; color:var(--muted)}
.b2b-kup-cijena{flex:0 0 auto; min-width:90px; text-align:right}
.b2b-kup-row .b2b-art-add{flex:0 0 auto; margin-top:0; width:150px}
@media (max-width:640px){
  .b2b-kup-row{flex-wrap:wrap}
  .b2b-kup-cijena{order:2}
  .b2b-kup-row .b2b-art-add{width:100%; order:3}
}
