:root {
  /* ================================
     B2B Visual Patch v2026-02-22
     - hierarchy + spacing + focus
     - hover/disabled affordances
     - denser screens become readable
     ================================ */

  --b2b-bg: #0b1020;
  --b2b-card: rgba(255,255,255,0.06);
  --b2b-card2: rgba(255,255,255,0.10);
  --b2b-border: rgba(255,255,255,0.14);
  --b2b-text: rgba(255,255,255,0.92);
  --b2b-muted: rgba(255,255,255,0.70);
  --b2b-accent: #7c5cff;
  --b2b-accent2: #00d4ff;
  --b2b-danger: #ff4d6d;
  --b2b-ok: #2bd576;
  --b2b-warn: #ffb020;
  --b2b-radius: 14px;
  --b2b-radius-sm: 12px;
  --b2b-focus: 0 0 0 3px rgba(124, 92, 255, 0.35);
}

body {
  margin: 0;
  font-family: 'Spoqa Han Sans', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1000px 500px at 10% 0%, rgba(124,92,255,0.18), transparent 60%),
              radial-gradient(1200px 700px at 90% 10%, rgba(0,212,255,0.14), transparent 60%),
              var(--b2b-bg);
  color: var(--b2b-text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

*, *::before, *::after { box-sizing: border-box; }

:where(button, input, select, textarea, a):focus { outline: none; }
:where(button, input, select, textarea, a):focus-visible { box-shadow: var(--b2b-focus); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

.b2b-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.b2b-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--b2b-border);
  backdrop-filter: blur(10px);
  background: rgba(11,15,23,0.75);
  position: sticky;
  top: 0;
  z-index: 10;
}

.b2b-brand {
  font-weight: 800;
  letter-spacing: 0.4px;
}

.b2b-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.b2b-lang button {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--b2b-border);
  background: transparent;
  color: var(--b2b-muted);
  cursor: pointer;
}
.b2b-lang button.is-on {
  color: var(--b2b-text);
  border-color: rgba(124,92,255,0.65);
  background: rgba(124,92,255,0.10);
}

.b2b-logout {
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--b2b-border);
  background: rgba(255,255,255,0.04);
  color: var(--b2b-text);
  cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease;
}
.b2b-logout:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.18); }

.b2b-main {
  flex: 1;
  padding: 12px 12px 76px;
}

.b2b-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 10px 10px;
  border-top: 1px solid var(--b2b-border);
  background: rgba(11,15,23,0.9);
  backdrop-filter: blur(10px);
}

.b2b-nav a {
  text-decoration: none;
  color: var(--b2b-muted);
  font-size: 12px;
  text-align: center;
  padding: 8px 0;
  border-radius: 10px;
}

.b2b-nav a.is-active {
  color: var(--b2b-text);
  background: rgba(124,92,255,0.14);
  border: 1px solid rgba(124,92,255,0.35);
}

.b2b-page { max-width: 1050px; margin: 0 auto; }
.b2b-h2 { margin: 8px 0 10px; font-size: 18px; }
.b2b-muted { color: var(--b2b-muted); }

.b2b-card {
  border: 1px solid var(--b2b-border);
  background: var(--b2b-card);
  border-radius: var(--b2b-radius);
  padding: 12px;
  transition: transform .15s ease, border-color .15s ease;
}
.b2b-card:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.18); }

.b2b-btn {
  padding: 10px 12px;
  border-radius: var(--b2b-radius-sm);
  border: 1px solid var(--b2b-border);
  background: rgba(255,255,255,0.04);
  color: var(--b2b-text);
  cursor: pointer;
  font-weight: 700;
  transition: transform .12s ease, background-color .12s ease, border-color .12s ease, opacity .12s ease;
}
.b2b-btn:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.20); }
.b2b-btn:active { transform: translateY(1px); }
.b2b-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.b2b-btn--primary {
  border: none;
  background: linear-gradient(135deg, var(--b2b-accent), var(--b2b-accent2));
  color: #081023;
}
.b2b-btn--primary:hover { filter: brightness(1.03); }

.b2b-input {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--b2b-radius-sm);
  border: 1px solid var(--b2b-border);
  background: rgba(255,255,255,0.03);
  color: var(--b2b-text);
}

.b2b-auth {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 16px;
}
.b2b-auth__title { margin: 0 0 12px; }
.b2b-auth .b2b-card { width: 100%; max-width: 420px; }
.b2b-field { display: block; margin-bottom: 10px; }
.b2b-field__label { font-size: 12px; color: var(--b2b-muted); margin-bottom: 6px; }
.b2b-field input, .b2b-field textarea, .b2b-chat__composer input, .b2b-chat__composer select {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--b2b-radius-sm);
  border: 1px solid var(--b2b-border);
  background: rgba(255,255,255,0.03);
  color: var(--b2b-text);
  box-sizing: border-box;
}
.b2b-auth__links { margin-top: 10px; display: flex; gap: 10px; align-items: center; justify-content: center; }
.b2b-auth__links a { color: var(--b2b-accent); text-decoration: none; }
.b2b-auth__links a:hover { text-decoration: underline; }
.b2b-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--b2b-border); }

.b2b-shop__top { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }

.b2b-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.b2b-tags button {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--b2b-border);
  background: rgba(255,255,255,0.03);
  color: var(--b2b-muted);
  cursor: pointer;
}
.b2b-tags button.is-on {
  color: var(--b2b-text);
  border-color: rgba(124,92,255,0.55);
  background: rgba(124,92,255,0.14);
}

.b2b-shop__grid { display: grid; grid-template-columns: 1fr 340px; gap: 12px; }
@media (max-width: 980px) { .b2b-shop__grid { grid-template-columns: 1fr; } }

/* keep cart visible on desktop */
.b2b-shop__grid > .b2b-card:last-child { position: sticky; top: 76px; }
@media (max-width: 980px) { .b2b-shop__grid > .b2b-card:last-child { position: static; } }

.b2b-table { padding: 0; overflow: hidden; }
.b2b-table__head, .b2b-table__row {
  display: grid;
  grid-template-columns: 92px 1fr 120px 110px;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
}
.b2b-table__head { border-bottom: 1px solid var(--b2b-border); color: var(--b2b-muted); font-size: 12px; }
.b2b-table__row { border-bottom: 1px solid rgba(255,255,255,0.06); cursor: pointer; }
.b2b-table__row:hover { background: rgba(255,255,255,0.03); }
.b2b-table__row.is-disabled { opacity: 0.55; cursor: not-allowed; }
.b2b-table__row.is-disabled:hover { background: transparent; }

.b2b-thumb { width: 78px; height: 78px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.03); }
.b2b-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.b2b-thumb__ph { width: 100%; height: 100%; }
.b2b-title__main { font-weight: 700; }
.ta-r { text-align: right; }

.b2b-status { font-size: 12px; padding: 6px 10px; border-radius: 999px; display: inline-block; border: 1px solid var(--b2b-border); }
.b2b-status.st--green { color: #2ee59d; border-color: rgba(46,229,157,0.4); }
.b2b-status.st--blue { color: #67a7ff; border-color: rgba(103,167,255,0.4); }
.b2b-status.st--gray { color: rgba(255,255,255,0.55); }
.b2b-status.st--yellow { color: #f5d76e; border-color: rgba(245,215,110,0.35); }

.b2b-cart__head { font-weight: 800; margin-bottom: 8px; }
.b2b-cart__item { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.b2b-cart__name { font-size: 13px; }
.b2b-cart__controls { display: flex; align-items: center; gap: 8px; }
.b2b-cart__controls button { width: 28px; height: 28px; border-radius: 10px; border: 1px solid var(--b2b-border); background: rgba(255,255,255,0.03); color: var(--b2b-text); cursor: pointer; }
.b2b-cart__price { font-size: 12px; color: var(--b2b-muted); }
.b2b-cart__foot { margin-top: 10px; }
.b2b-cart__total { display: flex; justify-content: space-between; margin-bottom: 10px; }

.b2b-hint { color: var(--b2b-muted); margin-bottom: 10px; }
.b2b-warn { margin-top: 8px; color: #ffb020; }
.b2b-ok { margin-top: 8px; color: #2ee59d; }
.b2b-dev { margin-top: 8px; color: rgba(255,255,255,0.8); }

.b2b-order__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.b2b-order__no { font-weight: 800; }
.b2b-order__status {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--b2b-border);
  background: rgba(255,255,255,0.06);
  color: var(--b2b-text);
}

/* order status colors (mapped by class) */
.b2b-order__status--submitted,
.b2b-order__status--pending,
.b2b-order__status--payment_pending {
  background: rgba(255,176,32,0.10);
  border-color: rgba(255,176,32,0.25);
  color: rgba(255, 223, 170, 0.95);
}
.b2b-order__status--confirmed,
.b2b-order__status--preparing {
  background: rgba(124,92,255,0.12);
  border-color: rgba(124,92,255,0.30);
}
.b2b-order__status--paid,
.b2b-order__status--shipped,
.b2b-order__status--delivered,
.b2b-order__status--done {
  background: rgba(43,213,118,0.12);
  border-color: rgba(43,213,118,0.28);
}
.b2b-order__status--cancelled,
.b2b-order__status--canceled,
.b2b-order__status--refunded {
  background: rgba(255,77,109,0.12);
  border-color: rgba(255,77,109,0.28);
}
.b2b-order__items { margin-top: 10px; display: grid; gap: 8px; }
.b2b-order__item { display: flex; justify-content: space-between; gap: 10px; }
.b2b-order__name { font-size: 13px; }
.b2b-order__proofs { margin-top: 10px; }
.b2b-proof__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.b2b-proof__item { display: block; border: 1px solid rgba(255,255,255,0.12); border-radius: 10px; overflow: hidden; background: rgba(255,255,255,0.04); }
.b2b-proof__item img { width: 100%; height: 54px; object-fit: cover; display: block; }
@media (max-width: 560px) {
  .b2b-proof__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .b2b-proof__item img { height: 62px; }
}
.b2b-order__foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; border-top: 1px solid rgba(255,255,255,0.06); padding-top: 10px; }
.b2b-order__actions { display: flex; gap: 8px; align-items: center; }

.b2b-modal__mask { position: fixed; inset: 0; background: rgba(0,0,0,0.65); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.b2b-modal { width: 100%; max-width: 520px; border-radius: 14px; border: 1px solid var(--b2b-border); background: rgba(11,15,23,0.96); padding: 12px; }
.b2b-modal__title { font-weight: 800; margin-bottom: 10px; }
.b2b-modal__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }

.b2b-profile__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.b2b-profile__user { font-weight: 800; font-size: 16px; }
.b2b-exp__bar { width: 220px; height: 10px; border-radius: 999px; overflow: hidden; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); }
.b2b-exp__fill { height: 100%; background: rgba(110,231,255,0.55); }
@media (max-width: 520px) { .b2b-exp__bar { width: 160px; } }

.b2b-chat { padding: 0; overflow: hidden; }
.b2b-chat__msgs { max-height: 55vh; overflow: auto; padding: 12px; display: grid; gap: 10px; }
.b2b-msg { max-width: 80%; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.05); }
.b2b-msg.me { margin-left: auto; border-color: rgba(110,231,255,0.35); background: rgba(110,231,255,0.10); }
.b2b-msg__time { margin-top: 6px; font-size: 11px; color: rgba(255,255,255,0.55); }
.b2b-msg__card { border: 1px dashed rgba(255,255,255,0.20); border-radius: 12px; padding: 8px; margin-bottom: 8px; }
.b2b-msg__cardTitle { font-weight: 700; }
.b2b-chat__composer { border-top: 1px solid rgba(255,255,255,0.06); padding: 12px; display: grid; gap: 10px; }
.b2b-chat__row { display: grid; grid-template-columns: 1fr 110px; gap: 10px; align-items: center; }

.b2b-banner-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 980px) { .b2b-banner-row { grid-template-columns: 1fr; } }
.b2b-banner { display: block; color: var(--b2b-text); text-decoration: none; border: 1px solid var(--b2b-border); border-radius: 14px; overflow: hidden; background: rgba(255,255,255,0.05); }
.b2b-banner img { width: 100%; height: 160px; object-fit: cover; display: block; }
.b2b-banner__ph { width: 100%; height: 160px; background: rgba(255,255,255,0.04); }
.b2b-banner__title { padding: 10px 12px; font-weight: 700; }

.b2b-list { display: grid; gap: 10px; }
.b2b-list__item { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.b2b-list__title { font-weight: 700; }
.b2b-list__sub { color: var(--b2b-muted); margin-top: 4px; }

/* skeleton utility */
.b2b-skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.10), rgba(255,255,255,0.06));
  background-size: 220% 100%;
  animation: b2bShimmer 1.2s ease-in-out infinite;
}
@keyframes b2bShimmer { 0% { background-position: 0% 0%; } 100% { background-position: 100% 0%; } }

/* align legacy accent usages with new accent */
.b2b-exp__fill { background: rgba(124,92,255,0.55); }
.b2b-msg.me { border-color: rgba(124,92,255,0.35); background: rgba(124,92,255,0.10); }

@media (max-width: 520px) {
  .b2b-page { padding: 14px; }
  .b2b-table__head, .b2b-table__row { grid-template-columns: 78px 1fr 110px; }
  .b2b-table__head > :nth-child(4),
  .b2b-table__row > :nth-child(4) { display: none; }
}
