/* Jupiter Supply Supplier Portal — Stage 11 shared additions.
   Loaded AFTER each portal page's own <style>, so these rules win ties.
   Scope: PWA chrome (offline banner, mobile bottom navigation), WCAG AA
   focus visibility, and small-screen behaviour (scrollable tables,
   >=44px primary tap targets). Page layouts themselves are unchanged.
   Bump the ?v= on the <link> (and VERSION in sw.js) with any change. */

/* --- Focus visibility (WCAG AA): the portal palette's gold outline is
       2.10:1 on white, so the shared ring uses the darkened amber
       #826708 — 5.39:1 on white, 3.07:1 on navy, visible on both. --- */
:focus-visible {
  outline: 3px solid #826708;
  outline-offset: 2px;
}

/* --- Offline banner (inserted by portal-pwa.js as the first body
       child; scrolls with the page, the sticky top bar stays usable).
       Honest state only: it appears while the browser reports offline
       and disappears on reconnect. Nothing is queued or auto-sent. --- */
#jsp-offline {
  background: #0B1B2E;
  color: #FFFFFF;
  font-family: -apple-system, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  padding: 12px 16px;
  text-align: center;
}
#jsp-offline b { color: #C9A227; }
#jsp-offline[hidden] { display: none; }

/* --- Mobile bottom navigation (injected by portal-pwa.js; the spec's
       Stage 11 bottom nav. Desktop keeps each page's own top/side nav —
       the bar is display:none at >=769px.) --- */
#jsp-bnav { display: none; }

img { max-width: 100%; }

@media (max-width: 768px) {
  #jsp-bnav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: #0B1B2E;
    border-top: 2px solid #C9A227;
    padding-bottom: env(safe-area-inset-bottom);
  }
  #jsp-bnav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 56px;
    padding: 6px 2px;
    color: #C9D4E4;
    text-decoration: none;
    font-family: -apple-system, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
  }
  #jsp-bnav a .ic { font-size: 19px; line-height: 1; }
  #jsp-bnav a.on { color: #C9A227; }
  body.jsp-has-bnav { padding-bottom: 68px; }

  /* Data tables scroll inside their card instead of stretching the
     page: no horizontal page scroll at 375px. */
  .card table, .wrap table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  /* Primary actions: >=44px touch targets. */
  .btn { min-height: 44px; }
  .tab { min-height: 44px; }
  .top nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 2px;
  }
  .lang button { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}

/* --- Design pass 2026-11-15: shared brand language across portal pages
       (navy #0B1B2E / gold #C9A227, rounded cards, soft shadows). Loaded
       after each page's own styles, so these unify the chrome. --- */
.card { border-radius: 16px; box-shadow: 0 10px 28px rgba(11,27,46,.08); }
.top { border-bottom: 3px solid #C9A227; }
.btn { border-radius: 10px; }

/* --- Password visibility toggle (eye button injected by JS) --- */
.pw-wrap{position:relative;display:block}
.pw-wrap>input.pw-inp{width:100%;padding-right:46px!important}
.pw-eye{position:absolute;top:50%;right:6px;transform:translateY(-50%);width:34px;height:34px;min-height:34px;display:flex;align-items:center;justify-content:center;padding:0;background:transparent;border:0;border-radius:8px;color:#5b6b7f;cursor:pointer;z-index:2}
.pw-eye:hover{color:#0B1B2E;background:rgba(11,27,46,.07)}
.pw-eye svg{width:20px;height:20px;display:block;pointer-events:none}
