/* ============================================================
   byjawalli — Toptan Portal (B2B app)
   ============================================================ */

/* ---------- Login section (toptan.html) ---------- */
.login-band {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
@media (max-width: 900px) { .login-band { grid-template-columns: 1fr; } }
.login-card {
  background: var(--night);
  color: color-mix(in srgb, var(--paper) 78%, transparent);
  border-radius: var(--radius-xl);
  padding: clamp(2rem, 4vw, 3rem);
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.login-card h3 { color: var(--paper); margin-bottom: .4rem; }
.login-card .glow { position: absolute; width: 400px; height: 400px; border-radius: 100%; filter: blur(90px); opacity: .25; pointer-events: none; }
.login-card .glow.a { background: var(--gold); top: -180px; right: -140px; }
.login-card .field label { color: color-mix(in srgb, var(--paper) 55%, transparent); }
.login-card .field input {
  background: var(--night-2); border-color: var(--line-dark); color: var(--paper);
}
.login-card .field input:focus { background: var(--night-3); border-color: var(--gold); }
.login-closed input:disabled { opacity: .5; cursor: not-allowed; }
.demo-creds {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  padding: .9rem 1.1rem; border-radius: 14px;
  border: 1px dashed color-mix(in srgb, var(--gold) 55%, transparent);
  background: color-mix(in srgb, var(--gold) 8%, transparent);
  font-size: .84rem;
}
.demo-creds code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--night-3); color: var(--gold-2);
  padding: .25em .6em; border-radius: 8px; font-size: .82rem;
}
.login-err { color: #E08A6D; font-size: .85rem; display: none; }
.login-err.show { display: block; }

/* ============================================================
   PORTAL APP
   ============================================================ */
.portal-body { background: var(--paper); min-height: 100svh; }
.portal-app { display: grid; grid-template-columns: 264px 1fr; min-height: 100svh; }
@media (max-width: 980px) { .portal-app { grid-template-columns: 1fr; } }

/* ---------- Sidebar ---------- */
.p-side {
  background: var(--night);
  color: color-mix(in srgb, var(--paper) 72%, transparent);
  display: flex; flex-direction: column;
  padding: 1.8rem 1.3rem;
  position: sticky; top: 0; height: 100svh;
  z-index: 50;
}
.p-side .brand { color: var(--paper); font-size: 1.45rem; margin-inline: .6rem; }
.p-side .p-tag {
  margin: .7rem .6rem 0;
  font-size: .62rem; font-weight: 700; letter-spacing: .24em; text-transform: uppercase;
  color: var(--gold);
}
.p-nav { display: grid; gap: .25rem; margin-top: 2.2rem; }
.p-nav a {
  display: flex; align-items: center; gap: .85rem;
  padding: .8rem 1rem; border-radius: 12px;
  font-size: .92rem; font-weight: 550;
  color: color-mix(in srgb, var(--paper) 62%, transparent);
  transition: background-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
  position: relative;
}
.p-nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.p-nav a:hover { color: var(--paper); background: var(--night-2); transform: translateX(3px); }
.p-nav a.active { color: var(--night); background: var(--gold-2); font-weight: 700; }
.p-nav .badge {
  margin-inline-start: auto;
  min-width: 21px; height: 21px; padding: 0 .4em;
  border-radius: 100px; display: grid; place-items: center;
  background: var(--terra); color: #fff;
  font-size: .68rem; font-weight: 800;
}
.p-nav a.active .badge { background: var(--night); color: var(--gold-2); }
.p-user {
  margin-top: auto;
  border-top: 1px solid var(--line-dark);
  padding-top: 1.2rem;
  display: grid; gap: .8rem;
}
.p-user .u-row { display: flex; align-items: center; gap: .8rem; padding-inline: .4rem; }
.p-user .u-avatar {
  width: 40px; height: 40px; border-radius: 100px; flex: none;
  display: grid; place-items: center;
  background: var(--gold); color: var(--night);
  font-weight: 800; font-size: .9rem;
}
.p-user .u-name { font-size: .84rem; font-weight: 700; color: var(--paper); line-height: 1.3; }
.p-user .u-firm { font-size: .72rem; color: color-mix(in srgb, var(--paper) 46%, transparent); }
.p-logout {
  display: flex; align-items: center; justify-content: center; gap: .5em;
  padding: .65rem; border-radius: 10px;
  border: 1px solid var(--line-dark);
  font-size: .8rem; font-weight: 700;
  color: color-mix(in srgb, var(--paper) 62%, transparent);
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.p-logout:hover { background: var(--terra); border-color: var(--terra); color: #fff; }
.p-logout svg { width: 15px; height: 15px; }

@media (max-width: 980px) {
  .p-side {
    position: fixed; inset: auto 0 0 0; height: auto;
    flex-direction: row; align-items: center;
    padding: .5rem .6rem calc(.5rem + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line-dark);
  }
  .p-side .brand, .p-side .p-tag, .p-user .u-row, .p-side .p-note { display: none; }
  .p-nav { display: flex; margin: 0; flex: 1; justify-content: space-around; gap: 0; }
  .p-nav a { flex-direction: column; gap: .25rem; font-size: .6rem; padding: .5rem .55rem; letter-spacing: .02em; }
  .p-nav a:hover { transform: none; }
  .p-nav .badge { position: absolute; top: 2px; right: 6px; margin: 0; min-width: 17px; height: 17px; font-size: .6rem; }
  .p-user { margin: 0; border: 0; padding: 0; }
  .p-logout { border: 0; padding: .5rem; }
  .p-logout .lbl { display: none; }
  .portal-main { padding-bottom: 90px !important; }
}

/* ---------- Main column ---------- */
.portal-main { padding: clamp(1.2rem, 3vw, 2.6rem) clamp(1.2rem, 3.5vw, 3rem) 4rem; max-width: 1460px; width: 100%; margin-inline: auto; }
.p-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: clamp(1.4rem, 3vw, 2.2rem);
  flex-wrap: wrap;
}
.p-topbar h1 {
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 380;
}
.p-topbar .sub { font-size: .88rem; color: var(--mute); margin-top: .2rem; }
.p-topbar-right { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.demo-chip {
  display: inline-flex; align-items: center; gap: .5em;
  font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  padding: .55em 1em; border-radius: 100px;
  background: color-mix(in srgb, var(--terra) 14%, transparent);
  color: var(--terra); border: 1px solid color-mix(in srgb, var(--terra) 36%, transparent);
}
.demo-chip .d { width: 7px; height: 7px; border-radius: 100px; background: var(--terra); animation: pulse-d 2s infinite; }
@keyframes pulse-d { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ---------- Cards & KPIs ---------- */
.p-grid { display: grid; gap: 1.1rem; }
.p-grid.kpi { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .p-grid.kpi { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px)  { .p-grid.kpi { grid-template-columns: 1fr; } }

.p-card {
  background: var(--linen);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 2.4vw, 1.7rem);
  position: relative;
}
.p-card.dark { background: var(--night); border-color: transparent; color: color-mix(in srgb, var(--paper) 78%, transparent); }
.p-card.dark h3, .p-card.dark .kpi-val { color: var(--paper); }
.p-card h3 { font-size: 1.2rem; font-weight: 430; }

.kpi-label { font-size: .68rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); display: flex; align-items: center; gap: .6em; }
.kpi-label svg { width: 15px; height: 15px; color: var(--gold); }
.kpi-val {
  font-family: var(--font-display); font-weight: 380;
  font-size: clamp(1.7rem, 3vw, 2.3rem); color: var(--ink);
  margin-top: .5rem; letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.kpi-sub { font-size: .8rem; color: var(--mute); margin-top: .25rem; }
.kpi-sub.neg { color: var(--terra); font-weight: 600; }
.kpi-sub.pos { color: var(--sage-deep); font-weight: 600; }

.limit-bar { height: 7px; border-radius: 100px; background: var(--paper-2); border: 1px solid var(--line); overflow: hidden; margin-top: .8rem; }
.limit-bar .fill { height: 100%; border-radius: 100px; background: linear-gradient(90deg, var(--sage), var(--gold)); transition: width 1.2s var(--ease-out); }
.limit-bar .fill.hot { background: linear-gradient(90deg, var(--gold), var(--terra)); }

/* ---------- Section titles inside portal ---------- */
.p-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 2.2rem 0 1rem; flex-wrap: wrap; }
.p-sec h2 { font-size: 1.45rem; font-weight: 420; }
.p-sec .link-underline { font-size: .84rem; }

/* ---------- Market controls ---------- */
.market-bar { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.4rem; }
.market-bar .search {
  flex: 1; min-width: 220px;
  display: flex; align-items: center; gap: .6rem;
  background: var(--linen); border: 1px solid var(--line); border-radius: 100px;
  padding: .7em 1.2em;
}
.market-bar .search svg { width: 17px; height: 17px; color: var(--mute); flex: none; }
.market-bar .search input { border: 0; outline: 0; background: none; width: 100%; font-size: .92rem; }
.market-bar select {
  background: var(--linen); border: 1px solid var(--line); border-radius: 100px;
  padding: .7em 1.1em; font-size: .88rem; font-weight: 600; color: var(--ink-2);
}

/* ---------- Product cards (market) ---------- */
.m-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.2rem; }
.m-card {
  background: var(--linen); border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .5s var(--ease);
  display: flex; flex-direction: column;
}
.m-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--sand); }
.m-card .m-img { position: relative; aspect-ratio: 4 / 3.1; overflow: hidden; background: var(--paper-2); }
.m-card .m-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.m-card:hover .m-img img { transform: scale(1.06); }
.m-card .m-3d {
  position: absolute; top: .7rem; right: .7rem;
  display: inline-flex; align-items: center; gap: .4em;
  font-size: .62rem; font-weight: 800; letter-spacing: .1em;
  padding: .5em .8em; border-radius: 100px;
  background: rgba(19,16,9,.55); color: var(--gold-2);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.m-card .m-3d svg { width: 12px; height: 12px; }
.m-card .m-stock {
  position: absolute; bottom: .7rem; left: .7rem;
  font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: .45em .8em; border-radius: 100px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.m-stock.ok  { background: color-mix(in srgb, var(--sage) 80%, transparent); color: #fff; }
.m-stock.low { background: color-mix(in srgb, var(--gold) 85%, transparent); color: var(--night); }
.m-stock.pre { background: rgba(19,16,9,.6); color: var(--paper); }
.m-card .m-body { padding: 1.1rem 1.2rem 1.2rem; display: grid; gap: .3rem; flex: 1; }
.m-card .m-cat { font-size: .64rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); }
.m-card h4 { font-size: 1.12rem; font-weight: 440; }
.m-card .m-meta { font-size: .78rem; color: var(--mute); }
.m-card .m-colors { display: flex; gap: .35rem; margin-top: .3rem; }
.m-card .m-colors i { width: 14px; height: 14px; border-radius: 100px; border: 1px solid rgba(0,0,0,.12); }
.m-card .m-price-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: .6rem;
  border-top: 1px solid var(--line); margin-top: .7rem; padding-top: .7rem;
}
.m-card .m-price { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.m-card .m-price .u { font-family: var(--font-body); font-size: .68rem; color: var(--mute); font-weight: 600; }
.m-card .m-list { font-size: .74rem; color: var(--mute); text-decoration: line-through; }
.m-card .m-save { font-size: .7rem; font-weight: 800; color: var(--sage-deep); }

/* ---------- Product detail modal ---------- */
.p-modal {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: clamp(.6rem, 2vw, 2rem);
  background: rgba(19,16,9,.55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden;
  transition: opacity .4s var(--ease), visibility 0s .4s;
}
.p-modal.open { opacity: 1; visibility: visible; transition: opacity .4s var(--ease), visibility 0s; }
.p-modal .pm-box {
  width: min(1120px, 100%); max-height: min(92svh, 900px);
  background: var(--paper); border-radius: var(--radius-xl);
  display: grid; grid-template-columns: 1.05fr 1fr;
  overflow: hidden;
  transform: translateY(30px) scale(.98);
  transition: transform .5s var(--ease-out);
  box-shadow: var(--shadow-lg);
}
.p-modal.open .pm-box { transform: none; }
@media (max-width: 880px) {
  .p-modal { padding: 0; align-items: end; }
  .p-modal .pm-box { grid-template-columns: 1fr; max-height: 96svh; border-radius: 22px 22px 0 0; overflow-y: auto; }
}
.pm-visual {
  position: relative; background: var(--paper-2);
  min-height: 380px;
  display: grid;
}
@media (min-width: 881px) { .pm-visual { height: 100%; } }
.pm-visual .pm-photo, .pm-visual .pm-3d { grid-area: 1 / 1; width: 100%; height: 100%; min-height: 380px; }
.pm-visual .pm-photo img { width: 100%; height: 100%; object-fit: cover; }
.pm-visual .pm-3d { position: relative; }
.pm-visual .pm-3d canvas { width: 100% !important; height: 100% !important; display: block; }
.pm-3d .hint {
  position: absolute; bottom: .9rem; left: 50%; transform: translateX(-50%);
  font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--mute); background: color-mix(in srgb, var(--paper) 80%, transparent);
  padding: .5em 1em; border-radius: 100px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  pointer-events: none; white-space: nowrap;
}
.pm-tabs {
  position: absolute; top: .9rem; left: .9rem; z-index: 5;
  display: inline-flex; border-radius: 100px; overflow: hidden;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 85%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.pm-tabs button {
  padding: .6em 1.1em; font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--mute); display: inline-flex; align-items: center; gap: .45em;
}
.pm-tabs button svg { width: 13px; height: 13px; }
.pm-tabs button.active { background: var(--ink); color: var(--gold-2); }
.pm-close {
  position: absolute; top: .9rem; right: .9rem; z-index: 6;
  width: 40px; height: 40px; border-radius: 100px;
  display: grid; place-items: center;
  background: var(--ink); color: var(--paper);
  transition: background-color .3s var(--ease), transform .3s var(--ease);
}
.pm-close:hover { background: var(--terra); transform: rotate(90deg); }
.pm-close svg { width: 16px; height: 16px; }

.pm-info { padding: clamp(1.4rem, 3vw, 2.2rem); overflow-y: auto; }
.pm-info .m-cat { font-size: .64rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.pm-info h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 400; margin: .35rem 0 .3rem; }
.pm-info .pm-code { font-size: .76rem; color: var(--mute); font-family: ui-monospace, Menlo, monospace; }
.pm-info .pm-desc { font-size: .92rem; margin-top: .8rem; }

.pm-price-box {
  margin-top: 1.1rem; padding: 1rem 1.2rem;
  border-radius: 14px;
  background: var(--night); color: var(--paper);
  display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap;
}
.pm-price-box .big { font-family: var(--font-display); font-size: 1.9rem; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.pm-price-box .big .u { font-family: var(--font-body); font-size: .68rem; color: color-mix(in srgb, var(--paper) 55%, transparent); font-weight: 700; letter-spacing: .08em; }
.pm-price-box .old { font-size: .84rem; color: color-mix(in srgb, var(--paper) 45%, transparent); text-decoration: line-through; }
.pm-price-box .tagp { margin-inline-start: auto; font-size: .64rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-2); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); padding: .5em .9em; border-radius: 100px; }

.pm-tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .8rem; }
.pm-tiers .tier {
  border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem;
  text-align: center; background: var(--linen);
}
.pm-tiers .tier b { display: block; font-size: .95rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.pm-tiers .tier span { font-size: .68rem; color: var(--mute); font-weight: 700; }
.pm-tiers .tier.hit { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }

.pm-opts { display: grid; gap: 1rem; margin-top: 1.2rem; }
.pm-opt-label { font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); margin-bottom: .45rem; display: flex; justify-content: space-between; }
.pm-opt-label b { color: var(--ink); font-weight: 700; letter-spacing: 0; text-transform: none; }
.swatches { display: flex; gap: .5rem; flex-wrap: wrap; }
.swatch-dot {
  width: 34px; height: 34px; border-radius: 100px;
  border: 2px solid transparent;
  outline: 1px solid rgba(0,0,0,.14);
  outline-offset: -1px;
  cursor: pointer;
  transition: transform .25s var(--ease), border-color .25s var(--ease);
}
.swatch-dot:hover { transform: scale(1.12); }
.swatch-dot.active { border-color: var(--paper); outline: 2px solid var(--ink); }
.size-chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.size-chips .chip { padding: .5em 1em; font-size: .8rem; }

.qty-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .4rem; }
.qty-stepper {
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: 100px; background: var(--linen);
  overflow: hidden;
}
.qty-stepper button {
  width: 42px; height: 42px; display: grid; place-items: center;
  font-size: 1.15rem; color: var(--ink-2);
  transition: background-color .25s var(--ease);
}
.qty-stepper button:hover { background: var(--paper-2); }
.qty-stepper input {
  width: 74px; text-align: center; border: 0; background: none; outline: 0;
  font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button, .qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty-note { font-size: .74rem; color: var(--mute); }
.pm-line-total { font-size: .9rem; color: var(--ink-2); }
.pm-line-total b { font-family: var(--font-display); font-size: 1.25rem; color: var(--ink); font-variant-numeric: tabular-nums; }

.pm-add {
  margin-top: 1.2rem; width: 100%;
}
.pm-specs { margin-top: 1.6rem; }
.pm-specs h4 { font-size: .74rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); margin-bottom: .6rem; }
.spec-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.spec-table td { padding: .55rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table td:first-child { color: var(--mute); font-weight: 600; width: 42%; padding-right: 1rem; }
.spec-table td:last-child { color: var(--ink-2); }
.comp-bar { display: flex; height: 8px; border-radius: 100px; overflow: hidden; margin: .4rem 0 .3rem; }
.comp-bar i { height: 100%; }
.comp-legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .74rem; color: var(--mute); }
.comp-legend .k { display: inline-flex; align-items: center; gap: .4em; }
.comp-legend .k i { width: 9px; height: 9px; border-radius: 3px; }

/* ---------- Tables (orders / statement) ---------- */
.p-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--linen); }
.p-table { width: 100%; border-collapse: collapse; min-width: 700px; font-size: .88rem; }
.p-table th, .p-table td { padding: .95rem 1.1rem; text-align: left; border-bottom: 1px solid var(--line); }
.p-table thead th {
  font-size: .66rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase;
  color: var(--mute); background: var(--paper-2); white-space: nowrap;
}
.p-table tbody tr:last-child td { border-bottom: 0; }
.p-table tbody tr { transition: background-color .25s var(--ease); }
.p-table tbody tr:hover { background: color-mix(in srgb, var(--paper-2) 55%, transparent); }
.p-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-table .debit { color: var(--terra); font-weight: 600; }
.p-table .credit { color: var(--sage-deep); font-weight: 600; }
.p-table .doc { font-family: ui-monospace, Menlo, monospace; font-size: .78rem; color: var(--mute); }
.p-table tfoot td { background: var(--night); color: var(--paper); font-weight: 700; border: 0; }
.p-table .overdue-flag { display: inline-block; margin-left: .5em; font-size: .62rem; font-weight: 800; letter-spacing: .08em; color: var(--terra); border: 1px solid color-mix(in srgb, var(--terra) 40%, transparent); border-radius: 100px; padding: .2em .6em; vertical-align: middle; }

.status-pill {
  display: inline-flex; align-items: center; gap: .45em;
  font-size: .7rem; font-weight: 800; letter-spacing: .06em;
  padding: .45em .9em; border-radius: 100px; white-space: nowrap;
}
.status-pill i { width: 7px; height: 7px; border-radius: 100px; background: currentColor; }
.status-pill.ok    { background: color-mix(in srgb, var(--sage) 16%, transparent); color: var(--sage-deep); }
.status-pill.ship  { background: color-mix(in srgb, #6D87A8 18%, transparent); color: #4A6284; }
.status-pill.prod  { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.status-pill.wait  { background: color-mix(in srgb, var(--terra) 14%, transparent); color: var(--terra); }

/* ---------- Cart ---------- */
.cart-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.4rem; align-items: start; }
@media (max-width: 980px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-line {
  display: grid; grid-template-columns: 76px 1fr auto;
  gap: 1rem; align-items: center;
  padding: 1rem 0; border-bottom: 1px solid var(--line);
}
.cart-line:last-child { border-bottom: 0; }
.cart-line .cl-img { width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--paper-2); position: relative; }
.cart-line .cl-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-line .cl-img .dot { position: absolute; bottom: 5px; right: 5px; width: 15px; height: 15px; border-radius: 100px; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.cart-line h4 { font-size: .98rem; font-weight: 650; font-family: var(--font-body); }
.cart-line .cl-meta { font-size: .76rem; color: var(--mute); margin-top: .15rem; }
.cart-line .cl-qty { display: flex; align-items: center; gap: .9rem; margin-top: .55rem; flex-wrap: wrap; }
.cart-line .qty-stepper { transform: scale(.88); transform-origin: left center; }
.cart-line .cl-right { text-align: right; display: grid; gap: .4rem; justify-items: end; }
.cart-line .cl-total { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.cart-line .cl-unit { font-size: .72rem; color: var(--mute); }
.cl-remove {
  font-size: .72rem; font-weight: 700; color: var(--mute);
  display: inline-flex; align-items: center; gap: .35em;
  transition: color .25s var(--ease);
}
.cl-remove:hover { color: var(--terra); }
.cl-remove svg { width: 13px; height: 13px; }

.cart-summary .row { display: flex; justify-content: space-between; font-size: .92rem; padding: .55rem 0; }
.cart-summary .row.total { border-top: 1px solid var(--line); margin-top: .5rem; padding-top: 1rem; font-weight: 700; color: var(--ink); }
.cart-summary .row.total b { font-family: var(--font-display); font-size: 1.5rem; font-weight: 420; font-variant-numeric: tabular-nums; }
.cart-summary .save-note {
  margin-top: .8rem; padding: .8rem 1rem; border-radius: 12px;
  background: color-mix(in srgb, var(--sage) 12%, transparent);
  color: var(--sage-deep); font-size: .8rem; font-weight: 600;
}
.cart-empty { text-align: center; padding: 3.5rem 1rem; color: var(--mute); display: grid; gap: 1rem; justify-items: center; }
.cart-empty svg { width: 54px; height: 54px; opacity: .4; }

/* ---------- Dashboard extras ---------- */
.dash-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 1.1rem; align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.rep-card { display: flex; gap: 1rem; align-items: center; }
.rep-card .u-avatar { width: 52px; height: 52px; border-radius: 100px; display: grid; place-items: center; background: var(--paper-2); color: var(--gold); border: 1px solid var(--line); font-weight: 800; }
.rep-card .rc-name { font-weight: 700; color: var(--ink); font-size: .95rem; }
.rep-card .rc-role { font-size: .74rem; color: var(--mute); }
.rep-card .rc-links { display: flex; gap: .6rem; margin-top: .3rem; font-size: .8rem; }
.rep-card .rc-links a { color: var(--gold); font-weight: 700; }

/* ---------- Login view (portal.html when logged out) ---------- */
.portal-login {
  min-height: 100svh; display: grid; place-items: center;
  padding: 2rem 1.2rem;
  background:
    radial-gradient(70% 50% at 80% 0%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 60%),
    var(--paper);
}
.portal-login .pl-box { width: min(430px, 100%); }

/* ---------- Print (ekstre) ---------- */
@media print {
  body * { visibility: hidden; }
  .print-area, .print-area * { visibility: visible; }
  .print-area { position: absolute; inset: 0; padding: 1rem; }
  .p-side, .p-topbar, .toast, .cursor-dot, .cursor-ring { display: none !important; }
  body::after { display: none; }
}
