/**
 * Storelly B2B — admin slim layer.
 *
 * The B2B admin pages reuse the shared component library (storelly-admin-ui.css =
 * .spbwc-page-hero/.spbwc-block/.spbwc-stat-card/.spbwc-admin-table/.spbwc-empty-state…
 * and quotes-admin.css = .spbwc-q-detail/.spbwc-q-kpi/.spbwc-q-recap/.spbwc-q-timeline).
 * This file only adds the few B2B-specific atoms + status-pill variants on the
 * admin design tokens (_tokens.css → --st-*).
 */

/* ── Layout utilities (token-driven; replace inline styles) ── */
.spbwc-row { display: flex; align-items: center; gap: var(--nbd-space-3); flex-wrap: wrap; }
.spbwc-row--sm { gap: var(--nbd-space-2); }
.spbwc-row--tight { gap: var(--nbd-space-1); }
.spbwc-row--between { justify-content: space-between; }
.spbwc-row--end { justify-content: flex-end; }
.spbwc-row--top { align-items: flex-start; }
.spbwc-row--push { margin-left: auto; }
.spbwc-stack { display: flex; flex-direction: column; gap: var(--nbd-space-1); }
.spbwc-stack--end { align-items: flex-end; text-align: right; }
.spbwc-icon-xl { font-size: var(--st-icon-2xl); width: var(--st-icon-2xl); height: var(--st-icon-2xl); }
.spbwc-muted { color: var(--nbd-st-text-mute); }
.spbwc-muted-sm { color: var(--nbd-st-text-soft); font-size: var(--text-sm); }
.spbwc-amount { font-size: var(--text-3xl); font-weight: var(--font-bold); color: var(--st-brand-pressed); }
.spbwc-list__item-grow { flex: 1; min-width: 0; }
/* Compact input widths for inline forms */
.spbwc-input--xs { width: 90px; }
.spbwc-input--sm { width: 120px; }
.spbwc-input--md { width: 150px; }
.spbwc-input--mw-sm { max-width: 130px; }
.spbwc-input--mw-md { max-width: 220px; }
.spbwc-input--mw-lg { max-width: 260px; }
/* Mini key-value stat (recap cards) */
.spbwc-kv { display: flex; flex-direction: column; text-align: right; }
.spbwc-kv__v { font-size: var(--text-3xl); font-weight: var(--font-bold); color: var(--st-brand); line-height: 1.1; }
.spbwc-kv__l { font-size: var(--text-sm); color: var(--nbd-st-text-mute); text-transform: uppercase; letter-spacing: .04em; }

/* ── Customer-picker modal ───────────────────────────────── */
body.spbwc-modal-open { overflow: hidden; }
.spbwc-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 8vh var(--nbd-space-4) var(--nbd-space-4);
}
.spbwc-modal[hidden] { display: none; }
.spbwc-modal__backdrop { position: absolute; inset: 0; background: var(--st-overlay, rgba(16, 24, 40, 0.55)); }
.spbwc-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: var(--nbd-st-bg);
    border-radius: var(--nbd-radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: spbwc-modal-in 0.16s ease-out;
}
@keyframes spbwc-modal-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.spbwc-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--nbd-space-4) var(--nbd-space-5);
    border-bottom: 1px solid var(--nbd-st-border-light);
}
.spbwc-modal__head h2 { margin: 0; font-size: var(--text-2xl); }
.spbwc-modal__close {
    appearance: none; background: none; border: 0; cursor: pointer;
    font-size: 24px; line-height: 1; color: var(--nbd-st-text-mute); padding: 0 4px;
}
.spbwc-modal__close:hover { color: var(--nbd-st-text); }
.spbwc-modal__body { padding: var(--nbd-space-5); }
.spbwc-modal__body .spbwc-search-bar { max-width: none; margin-bottom: var(--nbd-space-3); }

.spbwc-picker__results { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto; }
.spbwc-picker__results li { margin: 0; }
.spbwc-picker__item {
    display: flex;
    align-items: center;
    gap: var(--nbd-space-3);
    padding: var(--nbd-space-2) var(--nbd-space-2);
    border-radius: var(--nbd-radius-md);
    text-decoration: none;
    color: var(--nbd-st-text);
}
.spbwc-picker__item:hover { background: var(--nbd-st-bg-soft); }
.spbwc-picker__meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.spbwc-picker__item .dashicons { color: var(--nbd-st-text-mute); }
.spbwc-picker__empty { padding: var(--nbd-space-4); color: var(--nbd-st-text-mute); text-align: center; }
.spbwc-picker__hint { margin-top: var(--nbd-space-3); }

/* Status pill variants used by SPBWC_B2B_Admin::status_pill(). */
.spbwc-pill {
    display: inline-block;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    line-height: 1.6;
    border-radius: var(--nbd-radius-pill);
    padding: 2px 10px;
    vertical-align: middle;
    background: var(--st-pill-draft-bg);
    color: var(--st-pill-draft-text);
}
.spbwc-pill--success { background: var(--st-pill-active-bg);   color: var(--st-pill-active-text); }
.spbwc-pill--warn    { background: var(--st-pill-pending-bg);  color: var(--st-pill-pending-text); }
.spbwc-pill--danger  { background: var(--st-pill-danger-bg);   color: var(--st-pill-danger-text); }
.spbwc-pill--info    { background: var(--st-pill-featured-bg); color: var(--st-pill-featured-text); }
.spbwc-pill--off,
.spbwc-pill--neutral { background: var(--st-pill-draft-bg);    color: var(--st-pill-draft-text); }

/* ── Atom: tabs ──────────────────────────────────────────── */
.spbwc-tabs {
    display: flex;
    gap: var(--nbd-space-1);
    flex-wrap: wrap;
    border-bottom: 1px solid var(--nbd-st-border-light);
    margin: var(--nbd-space-6) 0 var(--nbd-space-5);
}
.spbwc-tab {
    appearance: none;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: var(--nbd-space-2) var(--nbd-space-3);
    font-size: var(--text-md);
    font-weight: var(--font-semibold);
    color: var(--nbd-st-text-soft);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--nbd-space-1);
}
.spbwc-tab:hover { color: var(--st-brand); }
.spbwc-tab.is-active {
    color: var(--st-brand);
    border-bottom-color: var(--st-brand);
}
.spbwc-tab .count {
    background: var(--nbd-st-bg-soft);
    border-radius: var(--nbd-radius-pill);
    padding: 0 6px;
    font-size: var(--text-sm);
}
/* Detail panels: JS shows one at a time (instant switch, no reload); without
   JS every panel stays visible so the content is always reachable. */
.spbwc-b2b-detail.js .spbwc-b2b-panel { display: none; }
.spbwc-b2b-detail.js .spbwc-b2b-panel.is-active { display: block; }

/* ── Atom: avatar ────────────────────────────────────────── */
.spbwc-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--nbd-radius-pill);
    background: var(--st-brand-soft);
    color: var(--st-brand-pressed);
    font-size: var(--text-base);
    font-weight: var(--font-bold);
    text-transform: uppercase;
    flex: 0 0 auto;
    overflow: hidden;
}
.spbwc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.spbwc-avatar--sm { width: 24px; height: 24px; font-size: var(--text-sm); }
.spbwc-avatar--lg { width: 44px; height: 44px; font-size: var(--text-lg); }

/* ── Atom: usage meter ───────────────────────────────────── */
.spbwc-meter {
    display: block;
    width: 100%;
    max-width: 160px;
    height: 6px;
    border-radius: var(--nbd-radius-pill);
    background: var(--nbd-st-border-subtle);
    overflow: hidden;
}
.spbwc-meter__fill {
    display: block;
    height: 100%;
    border-radius: var(--nbd-radius-pill);
    background: var(--nbd-color-success);
}
.spbwc-meter--warn .spbwc-meter__fill { background: var(--nbd-color-warning); }
.spbwc-meter--danger .spbwc-meter__fill { background: var(--nbd-color-danger); }
.spbwc-meter__label { font-size: var(--text-sm); color: var(--nbd-st-text-mute); }

/* ── Atom: role chip ─────────────────────────────────────── */
.spbwc-role-chip {
    display: inline-block;
    font-size: var(--text-sm);
    font-weight: var(--font-bold);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: var(--nbd-radius-pill);
    padding: 2px 9px;
    background: var(--st-pill-draft-bg);
    color: var(--st-pill-draft-text);
}
.spbwc-role-chip--owner    { background: var(--st-pill-featured-bg); color: var(--st-pill-featured-text); }
.spbwc-role-chip--admin    { background: var(--st-brand-soft);      color: var(--st-brand-pressed); }
.spbwc-role-chip--approver { background: var(--st-pill-active-bg);  color: var(--st-pill-active-text); }
.spbwc-role-chip--requester{ background: var(--st-pill-pending-bg); color: var(--st-pill-pending-text); }
.spbwc-role-chip--viewer   { background: var(--st-pill-draft-bg);   color: var(--st-pill-draft-text); }

/* Neutral grey pill — for a bare .spbwc-block__badge on an unstyled block head. */
.spbwc-badge--neutral { background: var(--st-pill-draft-bg); color: var(--st-pill-draft-text); }

/* ── Members roster (company detail → Members tab) ───────── */
.spbwc-member-list { width: 100%; }

/* Column-header row — aligns labels with the body columns below. */
.spbwc-member-list__head {
    display: flex;
    align-items: center;
    gap: var(--nbd-space-3);
    padding: var(--nbd-space-2) var(--nbd-space-5);
    padding-inline-start: calc(var(--nbd-space-5) + 44px + var(--nbd-space-3));
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--nbd-st-text-mute);
    background: var(--nbd-st-bg-soft);
    border-bottom: 1px solid var(--nbd-st-border-subtle);
}
.spbwc-member-list__head .spbwc-member__role,
.spbwc-member-list__head .spbwc-member__limit { display: block; }

/* Roster row — give the flush list horizontal breathing room. */
.spbwc-member.spbwc-list__item {
    padding-inline-start: var(--nbd-space-5);
    padding-inline-end: var(--nbd-space-5);
}
.spbwc-member.spbwc-list__item:hover {
    color: var(--nbd-st-text);
    background: var(--nbd-st-bg-soft);
}

/* Identity column — name (+ owner chip) over email. */
.spbwc-member__id {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.spbwc-member__name {
    display: flex;
    align-items: center;
    gap: var(--nbd-space-2);
    min-width: 0;
    font-weight: var(--font-semibold);
    color: var(--nbd-st-text);
}
.spbwc-member__email {
    font-size: var(--text-sm);
    color: var(--nbd-st-text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Fixed columns keep chips + amounts vertically aligned across rows. */
.spbwc-member__role  { flex: 0 0 130px; }
.spbwc-member__limit {
    flex: 0 0 120px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: end;
    line-height: 1.25;
}
.spbwc-member__limit-val  { font-weight: var(--font-semibold); color: var(--nbd-st-text); }
.spbwc-member__limit-unit { font-size: var(--text-xs); color: var(--nbd-st-text-mute); text-transform: uppercase; letter-spacing: 0.04em; }
.spbwc-member__limit-none { font-size: var(--text-sm); color: var(--nbd-st-text-mute); }

@media (max-width: 600px) {
    .spbwc-member-list__head { display: none; }
    .spbwc-member.spbwc-list__item { flex-wrap: wrap; }
    .spbwc-member__role,
    .spbwc-member__limit {
        flex: 0 0 auto;
        align-items: flex-start;
        text-align: start;
        margin-inline-start: calc(44px + var(--nbd-space-3));
    }
}

/* ── B2B-specific: per-company pricing bind form ─────────── */
.spbwc-b2b-bind {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: var(--nbd-space-3);
    padding: var(--nbd-space-4);
    background: var(--nbd-st-bg-soft);
    border: 1px solid var(--nbd-st-border-light);
    border-radius: var(--nbd-radius-md);
    margin-top: var(--nbd-space-3);
}
.spbwc-b2b-bind label { display: flex; flex-direction: column; gap: var(--nbd-space-1); font-size: var(--text-sm); color: var(--nbd-st-text-soft); font-weight: var(--font-semibold); }

/* Tier cards grid (B2B Pricing) reuses .spbwc-list-grid + .spbwc-block. */
.spbwc-tier-discount {
    font-size: var(--text-4xl);
    font-weight: var(--font-bold);
    color: var(--st-brand);
    line-height: 1;
}

/* B2B Pricing — tier ladder rows. */
.spbwc-block__head .js-spbwc-add-tier { margin-left: auto; }
.spbwc-tier-row.is-new { background: var(--nbd-st-bg-soft); }
.spbwc-tier-row.is-new .spbwc-input { border-style: dashed; }

/* Square icon button used to drop an unsaved tier row. */
.spbwc-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--nbd-st-border-light);
    border-radius: var(--st-btn-radius);
    background: var(--nbd-st-bg);
    color: var(--nbd-st-text-mute);
    cursor: pointer;
    transition: color .12s ease, border-color .12s ease, background .12s ease;
}
.spbwc-icon-btn:hover {
    color: var(--nbd-color-danger);
    border-color: var(--nbd-color-danger);
    background: var(--st-pill-danger-bg);
}
.spbwc-icon-btn .dashicons { font-size: var(--st-icon-lg); width: var(--st-icon-lg); height: var(--st-icon-lg); line-height: 1; }

/* ── Detail panels: vertical rhythm between stacked cards ──────
   Cards inside a tab panel (and a panel's leading <form>) were flush; give
   consecutive blocks consistent breathing room so they never look glued. */
.spbwc-b2b-panel > .spbwc-block + .spbwc-block,
.spbwc-b2b-panel > form + .spbwc-block,
.spbwc-b2b-panel > .spbwc-block + form,
.spbwc-b2b-panel > form > .spbwc-block + .spbwc-block,
.spbwc-b2b-profile > .spbwc-block + .spbwc-block {
    margin-top: var(--nbd-space-5);
}
.spbwc-b2b-panel > .spbwc-q-kpis { margin-bottom: var(--nbd-space-5); }

/* Block head subtitle (used on the split Overview + Profile cards). */
.spbwc-block__subtitle {
    margin: 4px 0 0;
    font-size: var(--text-sm);
    color: var(--nbd-st-text-soft);
    font-weight: var(--font-regular, 400);
}
/* Split foot: helper text on the left, primary action on the right. */
.spbwc-block__foot--split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--nbd-space-4);
    flex-wrap: wrap;
}
.spbwc-block__foot--split .description { margin: 0; }
.spbwc-req { color: var(--nbd-color-danger); }

/* ── Company-profile tab: admin Brand Store editor ───────────── */
.spbwc-b2b-uploads {
    display: flex;
    gap: var(--nbd-space-4);
    flex-wrap: wrap;
}
.spbwc-b2b-upload { display: flex; flex-direction: column; gap: var(--nbd-space-1); }
.spbwc-b2b-upload__label {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--nbd-st-text-soft);
}
.spbwc-b2b-upload__box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 180px;
    min-height: 120px;
    padding: var(--nbd-space-3);
    text-align: center;
    background: var(--nbd-st-bg-soft);
    border: 1px dashed var(--nbd-st-border-light);
    border-radius: var(--nbd-radius-md);
    transition: border-color .12s ease, background .12s ease;
}
.spbwc-b2b-upload__box:hover { border-color: var(--st-brand); background: var(--st-brand-soft); }
.spbwc-b2b-upload__preview { max-width: 100%; max-height: 72px; border-radius: var(--nbd-radius-sm); object-fit: contain; }
.spbwc-b2b-upload__icon { font-size: var(--st-icon-2xl); width: var(--st-icon-2xl); height: var(--st-icon-2xl); color: var(--nbd-st-text-mute); }
.spbwc-b2b-upload__hint { font-size: var(--text-xs); color: var(--nbd-st-text-mute); }
.spbwc-b2b-upload input[type="file"] { font-size: var(--text-sm); max-width: 180px; }

.spbwc-b2b-colours { display: flex; gap: var(--nbd-space-4); flex-wrap: wrap; }
.spbwc-b2b-colour { display: flex; flex-direction: column; gap: var(--nbd-space-1); }
.spbwc-b2b-colour__label { font-size: var(--text-sm); font-weight: var(--font-semibold); color: var(--nbd-st-text-soft); }
.spbwc-b2b-colour__field {
    display: inline-flex;
    align-items: center;
    gap: var(--nbd-space-2);
    padding: 4px 8px;
    background: var(--nbd-st-bg-soft);
    border: 1px solid var(--nbd-st-border-light);
    border-radius: var(--nbd-radius-md);
}
.spbwc-b2b-colour__field input[type="color"] {
    width: 34px;
    height: 28px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}
.spbwc-b2b-colour__field code { font-size: var(--text-sm); color: var(--nbd-st-text); }

/* Style the raw native "Choose file" control inside the upload zones. */
.spbwc-b2b-upload input[type="file"] {
    font-size: var(--text-sm);
    color: var(--nbd-st-text-soft);
    max-width: 100%;
}
.spbwc-b2b-upload input[type="file"]::file-selector-button {
    margin-inline-end: 8px;
    padding: 5px 12px;
    border: 1px solid var(--st-brand-soft);
    border-radius: var(--nbd-radius-md);
    background: var(--nbd-st-bg);
    color: var(--st-brand);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
}
.spbwc-b2b-upload input[type="file"]::file-selector-button:hover {
    background: var(--st-brand-soft);
    border-color: var(--st-brand);
}

/* Consistent custom chevron on B2B selects (native arrow varies per browser). */
.spbwc-b2b-admin select.spbwc-input {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M2 2.5l4 4 4-4' stroke='%23667085' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    padding-inline-end: 30px;
}

/* ── Activation checklist (company detail) ───────────────────── */
.spbwc-activation { margin-bottom: var(--nbd-space-5); }
.spbwc-activation__meter {
    max-width: none;
    height: 8px;
    margin-bottom: var(--nbd-space-4);
}
.spbwc-activation__list { list-style: none; margin: 0; padding: 0; }
.spbwc-activation__step {
    display: flex;
    align-items: center;
    gap: var(--nbd-space-3);
    padding: var(--nbd-space-3) 0;
}
.spbwc-activation__step + .spbwc-activation__step { border-top: 1px solid var(--nbd-st-border-subtle); }
.spbwc-activation__icon {
    width: 26px;
    height: 26px;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--nbd-radius-pill);
    flex: 0 0 auto;
    background: var(--nbd-st-bg-soft);
    color: var(--nbd-st-text-mute);
}
.spbwc-activation__step.is-done .spbwc-activation__icon {
    background: var(--st-pill-active-bg);
    color: var(--st-pill-active-text);
}
.spbwc-activation__text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.spbwc-activation__label { font-weight: var(--font-semibold); color: var(--nbd-st-text); }
.spbwc-activation__step.is-done .spbwc-activation__label {
    color: var(--nbd-st-text-soft);
    text-decoration: line-through;
}
.spbwc-activation__hint { font-size: var(--text-sm); color: var(--nbd-st-text-mute); }

/* ── Pricing tab: product autocomplete picker ────────────────── */
.spbwc-prodpick__field { position: relative; display: inline-flex; align-items: center; }
.spbwc-prodpick__clear {
    position: absolute;
    inset-inline-end: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: var(--nbd-radius-pill);
    background: var(--nbd-st-bg-soft);
    color: var(--nbd-st-text-mute);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
}
.spbwc-prodpick__clear:hover { color: var(--nbd-color-danger); background: var(--st-pill-danger-bg); }
.spbwc-prodpick__results {
    position: absolute;
    top: calc(100% + 4px);
    inset-inline-start: 0;
    z-index: 50;
    width: 320px;
    max-height: 320px;
    overflow-y: auto;
    margin: 0;
    padding: 4px;
    list-style: none;
    background: var(--nbd-st-bg);
    border: 1px solid var(--nbd-st-border-light);
    border-radius: var(--nbd-radius-md);
    box-shadow: var(--shadow-lg);
}
.spbwc-prodpick__results li { margin: 0; }
.spbwc-prodpick__item {
    display: flex;
    align-items: center;
    gap: var(--nbd-space-3);
    width: 100%;
    padding: var(--nbd-space-2);
    border: 0;
    border-radius: var(--nbd-radius-sm);
    background: none;
    text-align: start;
    cursor: pointer;
}
.spbwc-prodpick__item:hover { background: var(--st-brand-soft); }
.spbwc-prodpick__thumb {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: var(--nbd-radius-sm);
    object-fit: cover;
    background: var(--nbd-st-bg-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--nbd-st-text-mute);
}
.spbwc-prodpick__thumb--ph { font-size: 18px; }
.spbwc-prodpick__meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.spbwc-prodpick__name {
    font-weight: var(--font-semibold);
    color: var(--nbd-st-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.spbwc-prodpick__sku { font-size: var(--text-xs); color: var(--nbd-st-text-mute); }
.spbwc-prodpick__price { font-weight: var(--font-bold); color: var(--st-brand-pressed); white-space: nowrap; }
.spbwc-prodpick__empty { padding: var(--nbd-space-3); color: var(--nbd-st-text-mute); text-align: center; font-size: var(--text-sm); }
/* Invalid flash when submitting with no product chosen. */
.spbwc-input--invalid {
    border-color: var(--nbd-color-danger) !important;
    box-shadow: 0 0 0 3px var(--st-pill-danger-bg) !important;
}

/* ── Hub: clickable stat cards (filter) + sortable headers ───── */
.spbwc-b2b-admin a.spbwc-stat-card {
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}
.spbwc-b2b-admin a.spbwc-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.spbwc-b2b-admin a.spbwc-stat-card.is-active {
    box-shadow: 0 0 0 2px var(--st-brand);
}
.spbwc-sort {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    cursor: pointer;
}
.spbwc-sort:hover,
.spbwc-sort.is-active { color: var(--st-brand); }
/* Outstanding balance in the hub table. */
.spbwc-owe { font-weight: var(--font-bold); color: var(--st-pill-pending-text); }
.spbwc-owe .woocommerce-Price-amount { font-weight: var(--font-bold); }

/* ── Account-credit tab: AJAX feedback + new-row flash ───────── */
.spbwc-credit-feedback {
    flex-basis: 100%;
    margin-top: 4px;
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--nbd-color-success);
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity .15s ease, transform .15s ease;
}
.spbwc-credit-feedback.is-shown { opacity: 1; transform: none; }
.spbwc-credit-feedback.is-error { color: var(--nbd-color-danger); }
@keyframes spbwc-row-flash {
    from { background: var(--st-brand-soft); }
    to   { background: transparent; }
}
.spbwc-row-flash > td { animation: spbwc-row-flash 1.4s ease-out; }

/* ── Companies hub: premium clickable rows ───────────────────── */
.spbwc-admin-table tr.spbwc-row-link { cursor: pointer; transition: background .14s ease, box-shadow .14s ease; }
.spbwc-admin-table tr.spbwc-row-link > td {
    padding-top: var(--nbd-space-4);
    padding-bottom: var(--nbd-space-4);
}
.spbwc-admin-table tr.spbwc-row-link:hover > td { background: var(--st-brand-soft); }
/* Brand accent stripe on hover (inset so it never shifts layout). */
.spbwc-admin-table tr.spbwc-row-link:hover > td:first-child { box-shadow: inset 3px 0 0 0 var(--st-brand); }
/* Larger logo + stronger company name to make B2B clients feel first-class. */
.spbwc-admin-table tr.spbwc-row-link > td:first-child .spbwc-avatar {
    width: 40px;
    height: 40px;
    box-shadow: 0 0 0 1px var(--nbd-st-border-subtle);
}
.spbwc-admin-table tr.spbwc-row-link > td:first-child a {
    text-decoration: none;
    color: var(--nbd-st-text);
}
.spbwc-admin-table tr.spbwc-row-link > td:first-child a strong {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
}
.spbwc-admin-table tr.spbwc-row-link:hover > td:first-child a strong { color: var(--st-brand-pressed); }

/* ── Currency code chip (credit "Amount" label) ──────────────── */
.spbwc-cur-code {
    display: inline-block;
    margin-inline-start: 4px;
    padding: 1px 6px;
    border-radius: var(--nbd-radius-sm);
    background: var(--nbd-st-bg-soft);
    border: 1px solid var(--nbd-st-border-subtle);
    font-size: var(--text-xs);
    font-weight: var(--font-bold);
    letter-spacing: 0.04em;
    color: var(--nbd-st-text-soft);
    vertical-align: middle;
}

/* ── Statement: bold, colour-coded money columns ─────────────── */
.spbwc-stmt-amt {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.spbwc-stmt-amt .woocommerce-Price-amount,
.spbwc-stmt-amt bdi {
    font-weight: var(--font-bold);
    font-size: var(--text-md);
}
.spbwc-stmt-amt--credit .woocommerce-Price-amount { color: var(--nbd-color-success); }
.spbwc-stmt-amt--debit .woocommerce-Price-amount { color: var(--nbd-st-text); }

/* ── Company-profile tab: roomy form fields ──────────────────── */
.spbwc-b2b-profile .spbwc-setting-row {
    grid-template-columns: 200px minmax(0, 1fr);
    align-items: start;
    column-gap: var(--nbd-space-5);
}
.spbwc-b2b-profile .spbwc-setting-row__label { padding-top: 7px; }
/* Inputs fill the field column instead of sitting tiny on the left. */
.spbwc-b2b-profile .spbwc-setting-row > .spbwc-input {
    width: 100%;
    max-width: 560px;
}
.spbwc-b2b-profile .spbwc-setting-row > textarea.spbwc-input {
    max-width: 640px;
    min-height: 110px;
    resize: vertical;
    line-height: 1.5;
}
/* Hint drops under the control (col 2), not in a far-right column. */
.spbwc-b2b-profile .spbwc-setting-row__hint {
    grid-column: 2;
    border-left: 0;
    padding-left: 0;
    margin-top: 4px;
}
@media (max-width: 782px) {
    .spbwc-b2b-profile .spbwc-setting-row { grid-template-columns: 1fr; }
    .spbwc-b2b-profile .spbwc-setting-row__label { padding-top: 0; }
    .spbwc-b2b-profile .spbwc-setting-row__hint { grid-column: 1; }
}

/* Profile save feedback (sticky-foot toast next to the button). */
.spbwc-profile-feedback {
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
    color: var(--nbd-color-success);
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity .15s ease, transform .15s ease;
}
.spbwc-profile-feedback.is-shown { opacity: 1; transform: none; }
.spbwc-profile-feedback.is-error { color: var(--nbd-color-danger); }
