/**
 * Portal theme — monochrome (black / white) polish
 * Loaded after styles.css
 */

:root {
    --font-sans: Outfit, "Segoe UI", sans-serif;
    --brand: #101012;
    --brand-hover: #26262a;
    --brand-soft: #f2f2f3;
    --surface: #f7f7f8;
    --surface-sidebar: #f2f2f3;
    --surface-card: #ffffff;
    --text: #101012;
    --text-subdued: #6e6e76;
    --border-subdued: rgba(16, 16, 18, 0.07);
    --border-strong: rgba(16, 16, 18, 0.14);
    --radius-card: 16px;
    --radius-control: 10px;

    /* Layered, realistic shadow stacks */
    --shadow-card:
        0 0 0 1px rgba(16, 16, 18, 0.02),
        0 1px 2px rgba(16, 16, 18, 0.04),
        0 2px 8px rgba(16, 16, 18, 0.03);
    --shadow-raised:
        0 0 0 1px rgba(16, 16, 18, 0.03),
        0 2px 4px rgba(16, 16, 18, 0.04),
        0 8px 24px rgba(16, 16, 18, 0.07);
    --shadow-float:
        0 0 0 1px rgba(16, 16, 18, 0.04),
        0 4px 12px rgba(16, 16, 18, 0.06),
        0 16px 48px rgba(16, 16, 18, 0.12);

    --bg-primary: var(--surface);
    --bg-secondary: #ededee;
    --bg-card: var(--surface-card);
    --bg-elevated: #ffffff;
    --primary: var(--brand);
    --primary-dark: var(--brand-hover);
    --primary-light: #333338;
    --text-primary: var(--text);
    --text-secondary: var(--text-subdued);
    --divider: var(--border-subdued);
    --border: var(--border-subdued);
    --shadow-1: var(--shadow-card);
    --shadow-2: var(--shadow-raised);
    --shadow-3: var(--shadow-float);

    --success: #15803d;
    --success-soft: #f0fdf4;
    --warning: #b45309;
    --warning-soft: #fffbeb;
    --error: #b91c1c;
    --error-soft: #fef2f2;
    --info: #3f3f46;
    --info-soft: #f4f4f5;
}

html,
body {
    font-family: var(--font-sans);
}

/* Top navigation loading bar */
.portal-top-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    height: 3px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    view-transition-name: none;
}

.portal-top-loader.is-active {
    opacity: 1;
}

.portal-top-loader-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #101012 0%, #2a2a2e 55%, #101012 100%);
    background-size: 200% 100%;
    box-shadow: 0 0 10px rgba(16, 16, 18, 0.35);
    transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: width;
}

.portal-top-loader.is-active .portal-top-loader-bar {
    animation: portal-top-loader-sheen 1.1s linear infinite;
}

.portal-top-loader.is-done .portal-top-loader-bar {
    animation: none;
    transition: width 0.18s ease, opacity 0.25s ease;
}

@keyframes portal-top-loader-sheen {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Cross-document page transitions (Chromium) + soft enter/leave fallback */
@view-transition {
    navigation: auto;
}

.sidebar {
    view-transition-name: portal-sidebar;
}

.main-content {
    view-transition-name: portal-main;
}

::view-transition-group(portal-sidebar) {
    animation-duration: 0.01ms;
}

::view-transition-old(portal-sidebar),
::view-transition-new(portal-sidebar) {
    animation: none;
    mix-blend-mode: normal;
    height: 100%;
    overflow: clip;
}

::view-transition-old(portal-main),
::view-transition-new(portal-main) {
    animation-duration: 0.26s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    mix-blend-mode: normal;
    height: 100%;
    overflow: clip;
}

::view-transition-old(portal-main) {
    animation-name: portal-vt-fade-out;
}

::view-transition-new(portal-main) {
    animation-name: portal-vt-fade-in;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.22s;
    animation-timing-function: ease;
}

@keyframes portal-vt-fade-out {
    to {
        opacity: 0;
        transform: translateY(-4px);
    }
}

@keyframes portal-vt-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

html.portal-nav-leaving .main-content {
    opacity: 0.45;
    transition: opacity 0.16s ease;
}

html.portal-page-enter .content-wrapper {
    animation: portal-page-enter 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes portal-page-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-top-loader-bar,
    .portal-top-loader.is-active .portal-top-loader-bar {
        animation: none;
        transition: width 0.15s ease;
    }

    @view-transition {
        navigation: none;
    }

    .sidebar,
    .main-content {
        view-transition-name: none;
    }

    html.portal-nav-leaving .main-content,
    html.portal-page-enter .content-wrapper {
        opacity: 1;
        transform: none;
        transition: none;
        animation: none;
    }

    .btn,
    .empty-state,
    .empty-state-icon,
    .portal-order-success-pop,
    .portal-cart-toast--delight::after {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

/* Windows UA styles use "MS Shell Dlg 2" on form controls unless overridden. */
button,
input,
select,
textarea,
optgroup,
.btn,
.input,
.select,
.textarea {
    font-family: var(--font-sans);
}

[data-theme="dark"] {
    --surface: #111213;
    --surface-sidebar: #1a1b1c;
    --surface-card: #1f2021;
    --text: #e3e5e7;
    --text-subdued: #8c9196;
    --border-subdued: #2e3033;
    --border-strong: #44474a;
    --brand: #f5f5f5;
    --brand-hover: #ffffff;
    --brand-soft: #2a2a2a;
    --primary: var(--brand);
    --primary-dark: var(--brand-hover);
    --primary-light: #d4d4d4;
    --bg-primary: var(--surface);
    --bg-secondary: #1a1b1c;
    --bg-card: var(--surface-card);
    --text-primary: var(--text);
    --text-secondary: var(--text-subdued);
    --divider: var(--border-subdued);
    --border: var(--border-subdued);
}

body {
    background: var(--surface);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    letter-spacing: -0.006em;
}

h1, h2, h3, h4,
.header-title,
.stat-card-value,
.portal-mini-stat-value {
    letter-spacing: -0.022em;
    font-feature-settings: "tnum" 0, "cv02", "cv03", "cv04", "cv11";
}

/* Numbers align like a spreadsheet everywhere money/stats live */
.stat-card-value,
.portal-mini-stat-value,
.portal-product-price-value,
.portal-cell-strong,
.data-table td,
.portal-preview-total strong {
    font-variant-numeric: tabular-nums;
}

/* Icons */
.portal-icon-wrap,
.nav-icon-svg-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: currentColor;
}

.portal-icon,
.nav-icon-svg {
    width: 18px;
    height: 18px;
    display: block;
}

.portal-icon--sm .portal-icon,
.portal-icon--sm.portal-icon {
    width: 16px;
    height: 16px;
}

.portal-icon--md .portal-icon {
    width: 22px;
    height: 22px;
}

.portal-icon--stat .portal-icon {
    width: 20px;
    height: 20px;
}

.portal-icon-fallback {
    font-size: 0.875rem;
    line-height: 1;
}

/* Layout */
.app-container {
    background: var(--surface);
    min-height: 100vh;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.main-content {
    flex: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.content-wrapper {
    padding: 20px 24px 32px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    overflow: visible;
}

/* Buttons */
.btn,
a.btn,
button.btn,
.btn:hover,
a.btn:hover,
button.btn:hover,
.btn:focus,
a.btn:focus,
.btn:active,
a.btn:active,
.btn:visited,
a.btn:visited {
    text-decoration: none !important;
}

.btn {
    text-transform: none;
    letter-spacing: -0.006em;
    border-radius: var(--radius-control);
    font-weight: 550;
    box-shadow: none;
    text-decoration: none;
    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.2s ease,
        transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
        color 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px) scale(1.015);
}

.btn:active {
    transform: translateY(0.5px) scale(0.985);
}

.btn-primary {
    background: linear-gradient(180deg, #2b2b30 0%, #151517 55%, #0e0e10 100%);
    color: #fff;
    border: 1px solid rgba(16, 16, 18, 0.9);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 1px 2px rgba(16, 16, 18, 0.24),
        0 4px 12px rgba(16, 16, 18, 0.12);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #38383e 0%, #202024 55%, #161618 100%);
    border-color: rgba(16, 16, 18, 0.9);
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.18),
        inset 0 -1px 0 rgba(0, 0, 0, 0.2),
        0 2px 4px rgba(16, 16, 18, 0.24),
        0 6px 20px rgba(16, 16, 18, 0.18);
}

.btn-secondary {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border: 1px solid rgba(16, 16, 18, 0.12);
    color: var(--text-primary);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 1px 2px rgba(16, 16, 18, 0.05);
}

.btn-secondary:hover {
    background: linear-gradient(180deg, #fafafa 0%, #f4f4f5 100%);
    border-color: rgba(16, 16, 18, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 2px 6px rgba(16, 16, 18, 0.08);
}

.btn .portal-icon-wrap,
.btn .portal-icon {
    width: 16px;
    height: 16px;
}

.btn-block {
    width: 100%;
}

/* Soft modern badges */
.badge,
.badgeColored {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 550;
    letter-spacing: 0;
    text-transform: none;
    border: 1px solid transparent;
    line-height: 1.2;
}

.badge-success {
    background: var(--success-soft);
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 18%, transparent);
}

.badge-warning {
    background: var(--warning-soft);
    color: var(--warning);
    border-color: color-mix(in srgb, var(--warning) 18%, transparent);
}

.badge-error {
    background: var(--error-soft);
    color: var(--error);
    border-color: color-mix(in srgb, var(--error) 18%, transparent);
}

.badge-info,
.badge-default {
    background: var(--info-soft);
    color: var(--info);
    border-color: var(--border-subdued);
}

.portal-status-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.portal-status-stack--inline {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.portal-status-stack--labeled {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px 14px;
}

.portal-status-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}

.portal-status-item-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.6875rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-subdued);
    line-height: 1;
}

.portal-status-item-label .portal-icon-wrap,
.portal-status-item-label .portal-icon {
    width: 12px;
    height: 12px;
    color: currentColor;
}

/* Inputs */
.input,
.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 12px;
    border-radius: var(--radius-control);
    font-size: 0.9375rem;
    background: var(--surface-card);
    border: 1px solid rgba(16, 16, 18, 0.1);
    color: var(--text-primary);
    box-shadow:
        inset 0 1px 2px rgba(16, 16, 18, 0.03),
        0 1px 0 rgba(255, 255, 255, 0.6);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:hover,
.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: rgba(16, 16, 18, 0.18);
}

.input:focus,
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow:
        inset 0 1px 2px rgba(16, 16, 18, 0.03),
        0 0 0 3.5px rgba(16, 16, 18, 0.09);
}

.card:hover {
    box-shadow: var(--shadow-card);
    transform: none;
}

.stat-card:hover {
    transform: none;
    box-shadow: var(--shadow-2);
}

.stat-card-title {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

.stat-card-icon {
    background: var(--brand-soft);
    color: var(--brand);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 10px;
    min-width: 36px;
}

/* Cards */
.card {
    border-radius: var(--radius-card);
    border: 1px solid var(--border-subdued);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(253, 253, 253, 1) 100%);
    box-shadow: var(--shadow-card);
    padding: 22px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    box-shadow: var(--shadow-card);
    transform: none;
}

.card-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.portal-card--table {
    padding: 0;
    overflow: hidden;
}

.portal-card--table > .card-section-head {
    margin: 0;
    padding: 18px 20px 16px;
    border-bottom: 1px solid var(--border-subdued);
}

.portal-card--table > .portal-table-wrap {
    border-radius: 0;
}

.card-section-title {
    margin: 0 0 4px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-section-desc {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-subdued);
}

/* Stat cards */
.stat-card {
    position: relative;
    border-radius: var(--radius-card);
    border: 1px solid var(--border-subdued);
    background: linear-gradient(180deg, #ffffff 0%, #fcfcfd 100%);
    box-shadow: var(--shadow-card);
    padding: 18px 20px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
    pointer-events: none;
}

.stat-card:hover {
    transform: none;
    box-shadow: var(--shadow-raised);
    border-color: var(--border-strong);
}

.stat-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(180deg, #1d1d21 0%, #101012 100%) !important;
    color: #fff !important;
    font-size: 0;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 2px 6px rgba(16, 16, 18, 0.18);
}

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.stat-card-title {
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

.dashboard-grid {
    gap: 16px;
    margin-bottom: 24px;
}

/* Sidebar */
.sidebar {
    position: relative;
    top: auto;
    align-self: stretch;
    width: 264px;
    height: 100%;
    max-height: none;
    flex-shrink: 0;
    background:
        linear-gradient(180deg, #f7f7f7 0%, #f3f3f3 48%, #efefef 100%);
    border-right: 1px solid var(--border-subdued);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    flex-shrink: 0;
    padding: 18px 16px 14px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    padding: 10px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(10, 10, 10, 0.06);
    box-shadow: 0 1px 2px rgba(10, 10, 10, 0.04);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.sidebar-brand:hover {
    background: #fff;
    border-color: rgba(10, 10, 10, 0.1);
}

.sidebar-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: contain;
    background: #fff;
}

.sidebar-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(180deg, #1d1d21 0%, #101012 100%);
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 2px 6px rgba(16, 16, 18, 0.18);
}

.sidebar-brand-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.sidebar-brand-text {
    font-size: 0.9375rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-brand-tag {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    text-transform: none;
    color: var(--text-subdued);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    padding: 4px 12px 12px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.sidebar-nav-label {
    margin: 0 0 8px;
    padding: 0 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #8a8a8a;
}

.sidebar-nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item-wrapper {
    border-left: none;
    margin-bottom: 0;
}

.nav-item {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    margin: 0;
    border-radius: 12px;
    gap: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    color: #525252;
    background: transparent;
    border: 1px solid transparent;
    text-decoration: none;
    display: flex;
    align-items: center;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-primary);
    border-color: rgba(10, 10, 10, 0.05);
}

.nav-item-wrapper.active > .nav-item,
.nav-item.active {
    background: linear-gradient(180deg, #232327 0%, #131315 60%, #0e0e10 100%);
    color: #fff;
    font-weight: 600;
    border-color: rgba(16, 16, 18, 0.9);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 1px 2px rgba(16, 16, 18, 0.2),
        0 8px 20px rgba(16, 16, 18, 0.16);
}

.nav-item-wrapper.active > .nav-item:hover,
.nav-item.active:hover {
    background: linear-gradient(180deg, #2b2b30 0%, #1a1a1e 60%, #131315 100%);
    color: #fff;
    border-color: rgba(16, 16, 18, 0.9);
}

.nav-item-icon {
    flex-shrink: 0;
    display: inline-flex;
}

.nav-item-icon-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: rgba(10, 10, 10, 0.05);
    color: inherit;
    transition: background 0.15s ease;
}

.nav-item:hover .nav-item-icon-chip {
    background: rgba(10, 10, 10, 0.08);
}

.nav-item-wrapper.active > .nav-item .nav-item-icon-chip,
.nav-item.active .nav-item-icon-chip {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.nav-item-icon-chip .portal-icon,
.nav-item-icon-chip .portal-icon-wrap {
    width: 16px;
    height: 16px;
}

.nav-item-text {
    flex: 1;
    min-width: 0;
}

.nav-item-arrow {
    flex-shrink: 0;
    opacity: 0.55;
    transition: transform 0.2s ease, opacity 0.15s ease;
}

.nav-item.has-dropdown.open .nav-item-arrow,
.nav-item-wrapper.is-open .nav-item-arrow {
    transform: rotate(180deg);
    opacity: 0.9;
}

.nav-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    background: transparent;
    margin: 0;
    padding: 0 0 0 18px;
}

.nav-dropdown.open {
    max-height: 320px;
    margin-top: 4px;
}

.nav-sub-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin: 0 0 2px;
    border-radius: 10px;
    color: #6b6b6b;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-sub-item:hover {
    background: rgba(255, 255, 255, 0.75);
    color: var(--text-primary);
}

.nav-sub-item.active {
    background: #fff;
    color: var(--text-primary);
    border-color: rgba(10, 10, 10, 0.08);
    font-weight: 600;
    box-shadow: var(--shadow-card);
}

.nav-sub-item-icon {
    display: inline-flex;
    width: 16px;
    color: inherit;
}

.sidebar-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 12px 12px 14px;
    border-top: 1px solid rgba(10, 10, 10, 0.06);
    display: grid;
    gap: 8px;
    background: rgba(255, 255, 255, 0.35);
}

.sidebar-distributor {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(10, 10, 10, 0.06);
    box-shadow: 0 1px 2px rgba(10, 10, 10, 0.03);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.sidebar-distributor:hover {
    background: #fff;
    border-color: rgba(10, 10, 10, 0.12);
    box-shadow: var(--shadow-card);
}

.sidebar-distributor-avatar {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: #0a0a0a;
    color: #fff;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.sidebar-distributor-avatar .portal-icon-wrap,
.sidebar-distributor-avatar .portal-icon {
    width: 16px;
    height: 16px;
}

.sidebar-distributor-meta {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.sidebar-distributor-name {
    font-size: 0.8125rem;
    font-weight: 650;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-distributor-detail {
    display: block;
    font-size: 0.71875rem;
    line-height: 1.35;
    color: var(--text-subdued);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(10, 10, 10, 0.06);
    box-shadow: 0 1px 2px rgba(10, 10, 10, 0.03);
}

.sidebar-user-avatar,
.user-menu-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #0a0a0a;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 0.8125rem;
    font-weight: 650;
    flex-shrink: 0;
}

.sidebar-user-meta {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.sidebar-user-name,
.user-menu-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--text-subdued);
}

.sidebar-user-partner {
    font-size: 0.75rem;
    color: var(--text-subdued);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-partner-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 220px;
    height: 44px;
    box-sizing: border-box;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(10, 10, 10, 0.08);
    background: #fff;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
}

.header-partner-badge span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-info-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-subdued);
    margin-bottom: 2px;
}

.portal-partner-summary {
    margin: 0 0 20px;
    padding: 14px 16px;
    border: 1px solid var(--border-subdued);
    border-radius: var(--radius-card);
    background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface-card));
}

.portal-partner-summary-main {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
}

.portal-partner-summary-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-subdued);
}

.portal-partner-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 0.8125rem;
    color: var(--text-subdued);
}

.portal-partner-summary-hint {
    margin: 10px 0 0;
    font-size: 0.75rem;
    color: var(--text-subdued);
}

.portal-address-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.portal-address-item {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-subdued);
    border-radius: 12px;
    background: var(--surface-card, #fff);
}

.portal-address-item.is-latest {
    border-color: rgba(16, 16, 18, 0.28);
}

.portal-address-item__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 220px;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text);
}

.portal-address-badge {
    display: inline-flex;
    align-self: flex-start;
    margin-top: 2px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-subdued);
}

.portal-address-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.portal-inline-form {
    display: inline;
    margin: 0;
}

.portal-muted {
    margin: 0;
    color: var(--text-subdued);
    font-size: 0.875rem;
}

.portal-field--full {
    grid-column: 1 / -1;
}

.portal-settings-form .portal-field .input,
.portal-settings-form .portal-field input {
    width: 100%;
    box-sizing: border-box;
}

.portal-settings-nav {
    display: flex;
    gap: 4px;
    padding: 4px;
    margin-bottom: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subdued);
    border-radius: var(--radius-control);
    overflow-x: auto;
}

.portal-settings-nav-item {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: max-content;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-subdued);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease;
}

.portal-settings-nav-item:hover {
    color: var(--text-primary);
    background: color-mix(in srgb, var(--surface-card) 70%, transparent);
}

.portal-settings-nav-item.is-active {
    background: var(--surface-card);
    color: var(--text-primary);
    box-shadow: var(--shadow-card);
}

.invite-email {
    background: var(--bg-secondary, #f4f4f5);
    border: 1px solid var(--border-subdued);
    border-radius: 12px;
    padding: 12px 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
    font-size: 0.9375rem;
    font-weight: 500;
    word-break: break-all;
    color: var(--text-primary);
}

.login-form-wrap .invite-email {
    margin-top: 0;
    background: #fff;
    border-color: rgba(16, 16, 18, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.portal-form-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.portal-inline-form {
    display: inline;
    margin: 0;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 0.75rem;
}

@media (max-width: 900px) {
    .header-partner-badge {
        display: none;
    }
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(16px) saturate(1.5);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    border-bottom: 1px solid var(--border-subdued);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
    padding: 0;
    min-height: 64px;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 12px 24px;
    min-height: 64px;
}

.dashboard-footer {
    padding-left: 24px;
    padding-right: 24px;
}

.dashboard-footer .footer-content {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.header-title {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.header-subtitle {
    margin: 2px 0 0;
    font-size: 0.8125rem;
    color: var(--text-subdued);
}

.header-icon-btn,
.mobile-menu-btn,
.user-menu-button {
    --header-control-size: 44px;
    --header-control-radius: 14px;
    --header-control-icon: 22px;
}

.header-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--header-control-size);
    height: var(--header-control-size);
    min-width: var(--header-control-size);
    padding: 0;
    border: 1px solid rgba(10, 10, 10, 0.08);
    border-radius: var(--header-control-radius);
    background: #fff;
    color: var(--text-subdued);
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.header-icon-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: rgba(10, 10, 10, 0.14);
}

.header-icon-btn .portal-icon-wrap,
.header-icon-btn .portal-icon {
    width: var(--header-control-icon);
    height: var(--header-control-icon);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.lang-switcher-btn {
    width: auto;
    min-width: var(--header-control-size);
    height: var(--header-control-size);
    padding: 0 12px;
    gap: 6px;
}

.lang-switcher-code {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
}

.lang-switcher-dropdown {
    min-width: 160px;
    right: 0;
    left: auto;
}

.lang-switcher-option--active {
    font-weight: 600;
    color: var(--text-primary);
}

.user-menu-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: var(--header-control-size);
    min-height: var(--header-control-size);
    box-sizing: border-box;
    border: 1px solid rgba(10, 10, 10, 0.08);
    border-radius: 999px;
    padding: 0 12px 0 6px;
    background: #fff;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.user-menu-button:hover {
    background: var(--bg-secondary);
    border-color: rgba(10, 10, 10, 0.14);
}

.header-right .user-menu-avatar {
    width: 32px;
    height: 32px;
    font-size: 0.8125rem;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-menu-item-icon {
    display: inline-flex;
    color: var(--text-subdued);
}

/* Floating menus — solid, elevated */
.user-menu-dropdown {
    border: 1px solid rgba(16, 16, 18, 0.1);
    border-radius: 16px;
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: var(--shadow-float);
    padding: 6px;
}

.user-menu-dropdown .user-menu-item {
    border-radius: 10px;
    transition: background 0.12s ease;
}

.user-menu-dropdown .user-menu-info {
    border-radius: 10px 10px 0 0;
}

/* Tables */
.data-table-container,
.portal-card--table,
.card.portal-card:has(> .portal-table-wrap) {
    border: 1px solid var(--border-subdued);
    border-radius: var(--radius-card);
    overflow: hidden;
    background: var(--surface-card);
    box-shadow: var(--shadow-card);
}

.portal-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.portal-table-wrap > .data-table,
table.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}

.data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 12px 18px;
    background: color-mix(in srgb, var(--surface) 72%, #fff);
    border-bottom: 1px solid var(--border-subdued);
    font-size: 0.6875rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #8b8b94;
    white-space: nowrap;
    text-align: left;
}

.data-table td {
    padding: 16px 18px;
    font-size: 0.875rem;
    vertical-align: middle;
    border-bottom: 1px solid color-mix(in srgb, var(--border-subdued) 85%, transparent);
    color: var(--text-primary);
}

.data-table tbody tr {
    transition: background 0.14s ease;
}

.data-table tbody tr:hover {
    background: color-mix(in srgb, var(--brand) 3.5%, transparent);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table th.portal-col-actions,
.data-table td.portal-col-actions,
.data-table td.portal-table-actions {
    text-align: right;
    width: 1%;
    white-space: nowrap;
}

/* Order row filter motion — animate cells (tr transform is unreliable in table layout) */
.portal-order-row.is-filter-exit {
    pointer-events: none;
}

.portal-order-row.is-filter-exit > td,
.portal-order-row.is-filter-enter > td {
    will-change: opacity, transform, filter;
}

@media (prefers-reduced-motion: reduce) {
    .portal-order-row.is-filter-exit > td,
    .portal-order-row.is-filter-enter > td {
        will-change: auto;
    }
}

.portal-order-ref {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    min-width: 0;
}

.portal-order-ref-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    min-width: 0;
}

.portal-order-number {
    font-weight: 650;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.portal-order-date {
    font-size: 0.78125rem;
    color: var(--text-subdued);
}

.portal-order-qty {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.portal-order-method {
    display: inline-flex;
    align-items: center;
    font-size: 0.71875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-subdued);
}

.portal-order-products {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 240px;
    max-width: 420px;
}

.portal-order-product-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.portal-order-product-line {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.portal-order-product-thumb {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subdued);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-order-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.portal-order-product-thumb--empty {
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--brand) 8%, #fff), var(--bg-secondary));
}

.portal-order-product-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 8px;
    row-gap: 2px;
    min-width: 0;
}

.portal-order-product-name {
    font-size: 0.84375rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.portal-order-product-sku {
    font-size: 0.71875rem;
    color: var(--text-subdued);
    font-variant-numeric: tabular-nums;
}

.portal-order-product-meta {
    font-size: 0.75rem;
    color: var(--text-subdued);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.portal-order-product-more {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-subdued);
    white-space: nowrap;
}

.portal-order-product-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

.portal-order-products-preview {
    font-size: 0.78125rem;
    color: var(--text-subdued);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portal-order-total {
    font-size: 0.9375rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

#portalOrdersTable.data-table td {
    padding-top: 12px;
    padding-bottom: 12px;
}

.btn.portal-btn-table {
    padding: 7px 12px;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: -0.01em;
    box-shadow: none;
    border: 1px solid var(--border-subdued);
    background: #fff;
    color: var(--text-primary);
}

.btn.portal-btn-table:hover {
    background: var(--bg-secondary);
    border-color: var(--border-strong);
    transform: none;
    box-shadow: none;
}

.btn.portal-btn-table:active {
    transform: none;
}

/* Badges & pills */
.badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand) 5%, var(--bg-secondary));
    border: 1px solid color-mix(in srgb, var(--brand) 8%, var(--border-subdued));
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.badge-pill .portal-icon-wrap {
    color: var(--text-subdued);
}

/* Empty / chart states */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-subdued);
    animation: portal-empty-state-rise 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--bg-secondary);
    color: var(--text-subdued);
    margin-bottom: 12px;
    animation: portal-empty-icon-float 3.2s ease-in-out infinite;
}

.empty-state-icon .portal-icon {
    width: 28px;
    height: 28px;
}

/* Login — modern split: white brand/form panel + atmospheric aside */
.login-loading {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    background: rgba(247, 247, 248, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.login-loading.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.login-loading__spinner {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2.5px solid rgba(17, 17, 17, 0.12);
    border-top-color: #101012;
    animation: loginSpin 0.7s linear infinite;
}

.login-loading__text {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #101012;
    letter-spacing: -0.01em;
    font-family: var(--font-sans);
}

@keyframes loginSpin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .login-loading__spinner {
        animation: none;
        border-top-color: #101012;
    }

    .login-loading {
        transition: none;
    }
}

.login-body {
    margin: 0;
    min-height: 100vh;
    background: #f4f4f5;
    font-family: var(--font-sans);
    color: #101012;
}

.login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

.login-page-main {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: clamp(24px, 4vw, 40px);
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    animation: loginMainIn 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-main-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.login-brand-mark {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.login-logo-img,
.login-logo-fallback {
    display: block;
    height: 44px;
    width: auto;
    max-width: min(200px, 42vw);
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
    padding: 6px 8px;
    box-sizing: content-box;
    /* border: 1px solid rgba(16, 16, 18, 0.06); */
}

.login-logo-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #101012;
}

.login-brand-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.login-brand-name {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #101012;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.login-brand-tag {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6e6e76;
}

.login-lang {
    flex-shrink: 0;
}

.login-form-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: clamp(32px, 6vh, 64px) 0;
}

.login-form-intro {
    margin-bottom: 28px;
}

.login-form-title {
    margin: 0 0 8px;
    font-family: var(--font-sans);
    font-size: clamp(1.85rem, 3.2vw, 2.35rem);
    font-weight: 650;
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: #101012;
}

.login-form-lead {
    margin: 0;
    font-size: 1rem;
    line-height: 1.5;
    color: #6e6e76;
}

.login-alert {
    margin-bottom: 20px;
}

.login-form .login-field,
.login-form-wrap > .login-field {
    margin-bottom: 16px;
}

.login-form .login-field label,
.login-form-wrap > .login-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #3f3f46;
}

.login-form .login-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px;
    border: 1px solid rgba(16, 16, 18, 0.14);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    color: #101012;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-form .login-field input::placeholder {
    color: #a1a1aa;
}

.login-form .login-field input:hover {
    border-color: rgba(16, 16, 18, 0.28);
}

.login-form .login-field input:focus {
    outline: none;
    border-color: #101012;
    box-shadow: 0 0 0 4px rgba(16, 16, 18, 0.08);
}

.login-forgot-link,
.login-meta-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #52525b;
    text-decoration: none;
}

.login-forgot-link:hover,
.login-meta-link a:hover {
    color: #101012;
    text-decoration: underline;
}

.login-meta-link {
    margin-top: 18px;
    text-align: center;
    width: 100%;
}

.login-meta-link a {
    color: inherit;
    text-decoration: none;
}

.login-submit {
    margin-top: 8px;
    min-height: 48px;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-align: center;
    box-sizing: border-box;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 160ms ease, filter 160ms ease;
}

a.login-submit {
    width: 100%;
}

.login-submit:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.login-submit:active {
    transform: translateY(0);
}

.login-main-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    font-size: 0.78rem;
    color: #9ca3af;
}

.login-main-foot a {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    transition: color 160ms ease;
}

.login-main-foot a:hover {
    color: #52525b;
}

.login-page-aside {
    position: relative;
    display: flex;
    align-items: center;
    padding: clamp(32px, 5vw, 56px);
    overflow: hidden;
    color: #f4f4f5;
    background:
        radial-gradient(900px 520px at 110% -10%, rgba(255, 255, 255, 0.1), transparent 55%),
        radial-gradient(700px 480px at -20% 120%, rgba(255, 255, 255, 0.05), transparent 50%),
        linear-gradient(155deg, #101012 0%, #17171b 48%, #222228 100%);
    animation: loginAsideIn 640ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.login-aside-glow {
    position: absolute;
    width: 52%;
    aspect-ratio: 1;
    right: -12%;
    top: 8%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 68%);
    filter: blur(8px);
    pointer-events: none;
    animation: loginGlowDrift 12s ease-in-out infinite alternate;
}

.login-aside-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(160deg, rgba(0, 0, 0, 0.55), transparent 72%);
    -webkit-mask-image: linear-gradient(160deg, rgba(0, 0, 0, 0.55), transparent 72%);
    pointer-events: none;
}

.login-aside-content {
    position: relative;
    z-index: 1;
    max-width: 420px;
}

.login-aside-eyebrow {
    margin: 0 0 14px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(244, 244, 245, 0.55);
}

.login-aside-title {
    margin: 0 0 14px;
    font-family: var(--font-sans);
    font-size: clamp(2rem, 3.6vw, 2.75rem);
    font-weight: 650;
    letter-spacing: -0.045em;
    line-height: 1.05;
    color: #fff;
}

.login-aside-lead {
    margin: 0 0 28px;
    font-size: 1.05rem;
    line-height: 1.55;
    color: rgba(244, 244, 245, 0.78);
}

.login-aside-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.login-aside-points li {
    position: relative;
    padding: 12px 14px 12px 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.92rem;
    line-height: 1.4;
    color: rgba(244, 244, 245, 0.88);
}

.login-aside-points li::before {
    content: "";
    position: absolute;
    left: 14px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    transform: translateY(-50%);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
}

@keyframes loginMainIn {
    from { opacity: 0; transform: translateX(-12px); }
    to { opacity: 1; transform: none; }
}

@keyframes loginAsideIn {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: none; }
}

@keyframes loginGlowDrift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to { transform: translate3d(-18px, 22px, 0) scale(1.08); }
}

@media (max-width: 960px) {
    .login-page { grid-template-columns: 1fr; }
    .login-page-aside { display: none; }
    .login-page-main { min-height: 100vh; }
}

@media (max-width: 560px) {
    .login-brand-copy { display: none; }
    .login-form-wrap { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    .login-page-main,
    .login-page-aside,
    .login-aside-glow,
    .login-submit {
        animation: none;
        transition: none;
    }
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-control);
    font-size: 0.9375rem;
    background: var(--surface-card);
    color: var(--text-primary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}

.alert-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-control);
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.alert-banner--error {
    background: var(--error-soft);
    border: 1px solid color-mix(in srgb, var(--error) 22%, transparent);
    color: var(--error);
}

.alert-banner--success {
    background: var(--success-soft);
    border: 1px solid color-mix(in srgb, var(--success) 22%, transparent);
    color: var(--success);
}

.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    flex-shrink: 0;
}

.status-icon--yes {
    background: var(--success-soft);
    color: var(--success);
}

.status-icon--no {
    background: var(--error-soft);
    color: var(--error);
}

/* Theme toggle visibility */
[data-theme="dark"] .sun-icon { display: none; }
[data-theme="dark"] .moon-icon { display: block; }
:root:not([data-theme="dark"]) .moon-icon,
html:not([data-theme="dark"]) .moon-icon { display: none; }

@media (max-width: 768px) {
    .content-wrapper {
        padding: 16px;
    }

    .header {
        padding: 0;
    }

    .header-inner {
        padding: 12px 16px;
    }

    .dashboard-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ── B2B portal pages ── */

.portal-welcome {
    margin: 0 0 16px;
    color: var(--text-subdued);
    font-size: 0.9375rem;
}

.portal-hero-intro {
    margin-bottom: 18px;
    padding: 18px 20px;
    background:
        radial-gradient(560px 160px at 100% 0%, rgba(255, 255, 255, 0.22), transparent 62%),
        linear-gradient(150deg, #1f1f24 0%, #111114 65%, #0d0d0f 100%);
    border: 1px solid rgba(16, 16, 18, 0.9);
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 8px 24px rgba(16, 16, 18, 0.2);
}

.portal-hero-kicker {
    margin: 0 0 8px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.portal-hero-title {
    margin: 0 0 6px;
    font-size: clamp(1.15rem, 2.2vw, 1.45rem);
    font-weight: 650;
    letter-spacing: -0.02em;
}

.portal-hero-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.88);
}

.portal-hero-note {
    margin: 6px 0 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.76);
}

.portal-discount-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 20px;
    border-radius: var(--radius-card);
    background:
        radial-gradient(600px 200px at 100% 0%, rgba(255, 255, 255, 0.08), transparent 60%),
        linear-gradient(140deg, #1a1a1e 0%, #101012 100%);
    border: 1px solid rgba(16, 16, 18, 0.9);
    color: #fff;
    font-size: 0.875rem;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 4px 16px rgba(16, 16, 18, 0.16);
}

.portal-discount-banner .portal-icon-wrap {
    color: rgba(255, 255, 255, 0.85);
}

.portal-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.portal-stat-grid--compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-orders-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 16px;
    flex-wrap: wrap;
}

.portal-orders-toolbar__action {
    flex: 0 0 auto;
}

.portal-orders-toolbar__action .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
}

.portal-orders-toolbar__filters {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 12px;
    flex: 1 1 320px;
    min-width: min(100%, 320px);
    overflow: visible;
}

.portal-orders-toolbar__filters .portal-filter {
    margin: 0;
    overflow: visible;
}

.portal-orders-toolbar__filters .portal-filter--search {
    flex: 1 1 220px;
    max-width: 320px;
}

.portal-orders-toolbar__filters .portal-filter--status {
    flex: 0 1 200px;
    min-width: 160px;
    max-width: 220px;
    position: relative;
    z-index: 5;
}

.portal-card {
    margin-bottom: 24px;
}

.portal-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.portal-page-header--actions-only {
    justify-content: flex-end;
    margin-bottom: 16px;
}

.portal-page-title {
    margin: 0 0 6px;
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.portal-page-lead {
    margin: 0 0 16px;
    color: var(--text-subdued);
    font-size: 0.9375rem;
    max-width: 52ch;
    line-height: 1.45;
}

.portal-back-link {
    display: inline-block;
    margin-bottom: 8px;
    color: var(--text-subdued);
    font-size: 0.875rem;
    text-decoration: none;
}

.portal-back-link:hover {
    color: var(--brand);
}

.portal-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.portal-quick-action.card {
    position: relative;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 2px;
    align-items: center;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.portal-quick-action.card:hover {
    box-shadow: var(--shadow-raised);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.portal-quick-action.card:hover .portal-quick-action-icon {
    transform: translateY(-1px) scale(1.05);
}

.portal-quick-action.card .portal-quick-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: linear-gradient(180deg, #1d1d21 0%, #101012 100%);
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 2px 6px rgba(16, 16, 18, 0.18);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.portal-quick-action.card .portal-quick-action-title {
    grid-column: 2;
    grid-row: 1;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.15;
}

.portal-quick-action.card .portal-quick-action-desc {
    grid-column: 2;
    grid-row: 2;
    color: var(--text-subdued);
    font-size: 0.75rem;
    line-height: 1.2;
}

.portal-spend-chart-card {
    margin-bottom: 28px;
}

.portal-spend-chart-head {
    align-items: center;
}

.portal-spend-chart-select {
    width: 160px;
    flex-shrink: 0;
}

.portal-spend-chart-canvas-wrap {
    position: relative;
    width: 100%;
    min-height: 240px;
}

.portal-spend-chart-svg {
    width: 100%;
    height: 240px;
    display: block;
}

.portal-spend-chart-grid {
    stroke: var(--border-subdued);
    stroke-width: 1;
}

.portal-spend-chart-area {
    fill: rgba(16, 16, 18, 0.08);
}

.portal-spend-chart-line {
    stroke: #18181b;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.portal-spend-chart-dot {
    fill: #ffffff;
    stroke: #18181b;
    stroke-width: 2;
    pointer-events: none;
}

.portal-spend-chart-hit {
    fill: transparent;
    cursor: crosshair;
}

.portal-spend-chart-axis-label {
    fill: var(--text-subdued);
    font-size: 11px;
    font-family: inherit;
}

.portal-spend-chart-tooltip {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    background: #111111;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 8px;
    white-space: nowrap;
    box-shadow: var(--shadow-1, 0 4px 14px rgba(16, 16, 18, 0.18));
}

.portal-spend-chart-empty {
    height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-subdued);
    background: var(--bg-secondary, rgba(16, 16, 18, 0.03));
    border: 1px solid var(--border-subdued);
    border-radius: 12px;
}

.portal-spend-chart-empty-icon,
.portal-spend-chart-empty-icon .portal-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.portal-spend-chart-empty-title {
    font-size: 0.875rem;
    font-weight: 550;
    color: var(--text-primary);
}

.portal-spend-chart-empty-hint {
    font-size: 0.75rem;
    margin-top: 4px;
}

[data-theme="dark"] .portal-spend-chart-area {
    fill: rgba(245, 245, 245, 0.08);
}

[data-theme="dark"] .portal-spend-chart-line {
    stroke: #f5f5f5;
}

[data-theme="dark"] .portal-spend-chart-dot {
    fill: #1f2021;
    stroke: #f5f5f5;
}

[data-theme="dark"] .portal-spend-chart-tooltip {
    background: #f5f5f5;
    color: #111111;
}

.portal-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.portal-cell-strong {
    font-weight: 650;
    letter-spacing: -0.015em;
}

.portal-cell-muted {
    color: var(--text-subdued);
    font-size: 0.78125rem;
    line-height: 1.35;
}

.portal-table-empty {
    text-align: center;
    padding: 40px 16px !important;
    color: var(--text-subdued);
    border-bottom: none !important;
}

.portal-filters-shell {
    position: relative;
    z-index: 80;
    padding: 0;
    margin-bottom: 12px;
    overflow: visible;
}

.card.portal-filters-shell {
    padding: 0;
}

.portal-filters-shell .portal-filters {
    margin-bottom: 0;
}

.portal-filters-shell .portal-filter-toolbar {
    padding: 0 16px 14px;
    margin-bottom: 0;
}

.portal-filters-toggle {
    display: none;
}

.portal-filters {
    position: relative;
    z-index: 80;
    display: grid;
    grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(140px, 1fr));
    gap: 12px;
    padding: 16px;
    margin-bottom: 12px;
    align-items: end;
    overflow: visible;
}

.portal-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-subdued);
    min-width: 0;
}

.portal-filter--search {
    min-width: 0;
}

.portal-search-field {
    position: relative;
    display: block;
    width: 100%;
}

.portal-search-field__icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-subdued);
    pointer-events: none;
    z-index: 1;
}

.portal-search-field__icon .portal-icon-wrap,
.portal-search-field__icon .portal-icon {
    width: 16px;
    height: 16px;
}

.portal-search-field .input,
.portal-search-field input[type="search"] {
    width: 100%;
    padding-left: 40px;
}

.portal-search-field .input::-webkit-search-decoration,
.portal-search-field .input::-webkit-search-cancel-button,
.portal-search-field input[type="search"]::-webkit-search-decoration,
.portal-search-field input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

/* Custom selects */
.portal-select {
    position: relative;
    width: 100%;
    z-index: 1;
}

.portal-select.is-open {
    z-index: 50;
}

.portal-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.portal-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 44px;
    text-align: left;
    cursor: pointer;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
}

.portal-select-trigger:hover {
    border-color: rgba(16, 16, 18, 0.18);
}

.portal-select.is-open .portal-select-trigger {
    border-color: var(--brand);
    box-shadow:
        inset 0 1px 2px rgba(16, 16, 18, 0.03),
        0 0 0 3.5px rgba(16, 16, 18, 0.09);
}

.portal-select-value {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-select-chevron {
    flex-shrink: 0;
    color: var(--text-subdued);
    transition: transform 0.18s ease;
}

.portal-select.is-open .portal-select-chevron {
    transform: rotate(180deg);
}

.portal-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 10070;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 280px;
    overflow: auto;
    padding: 6px;
    border: 1px solid rgba(16, 16, 18, 0.1);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--shadow-float);
}

.portal-select-menu[hidden] {
    display: none !important;
}

.portal-select-option {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}

.portal-select-option:hover {
    background: var(--bg-secondary);
}

.portal-select-option.is-active {
    background: #101012;
    color: #fff;
    font-weight: 600;
}

.portal-select-option.is-active:hover {
    background: #1a1a1e;
    color: #fff;
}

.portal-select--multi .portal-select-menu {
    padding: 8px;
    gap: 4px;
}

.portal-select-check {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 9px 10px;
    border-radius: 10px;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s ease;
}

.portal-select-check:hover {
    background: var(--bg-secondary);
}

.portal-select-check.is-active {
    background: color-mix(in srgb, var(--brand) 6%, #fff);
}

.portal-select-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.portal-select-check-box {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 6px;
    border: 1.5px solid rgba(16, 16, 18, 0.22);
    background: #fff;
    box-shadow: inset 0 1px 1px rgba(16, 16, 18, 0.04);
    position: relative;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.portal-select-check.is-active .portal-select-check-box {
    background: #101012;
    border-color: #101012;
}

.portal-select-check.is-active .portal-select-check-box::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.portal-select-check-label {
    min-width: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.3;
}

.portal-select--multi.has-value .portal-select-trigger {
    border-color: rgba(16, 16, 18, 0.2);
    font-weight: 600;
}

.portal-filter-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    min-height: 32px;
}

.portal-filter-count {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-subdued);
    transition: opacity 0.15s ease;
}

.portal-filter-count.is-updating {
    opacity: 0.45;
}

.portal-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

.portal-product-card {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr;
    height: 100%;
    overflow: hidden;
    padding: 0;
    background: var(--surface-card);
    border: 1px solid var(--border-subdued);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    opacity: 1;
    transform: translateY(0) scale(1);
    transition:
        opacity 0.2s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.portal-product-card:hover {
    box-shadow: var(--shadow-raised);
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.portal-product-card[hidden] {
    display: none !important;
}

.portal-product-card.is-filter-enter {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
}

.portal-product-card.is-filter-exit {
    opacity: 0;
    transform: scale(0.97);
    pointer-events: none;
}

#productFilterEmpty {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

#productFilterEmpty.is-filter-enter {
    opacity: 0;
    transform: translateY(8px);
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.22s;
}

@media (prefers-reduced-motion: reduce) {
    .portal-product-card,
    .portal-filter-count,
    #productFilterEmpty,
    .portal-filters-panel,
    .portal-filters-toggle__chevron {
        transition: none !important;
    }

    .portal-product-card.is-filter-enter,
    .portal-product-card.is-filter-exit,
    #productFilterEmpty.is-filter-enter {
        opacity: 1;
        transform: none;
    }

    .portal-product-stock-row--winding {
        animation: none !important;
    }
}

.portal-product-media {
    position: relative;
    aspect-ratio: 5 / 4;
    background: #fff;
    overflow: hidden;
    isolation: isolate;
}

.portal-product-media-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: clamp(6px, 1.5vw, 10px);
}

.portal-product-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center bottom;
    transition: transform 0.6s ease;
}

.portal-product-card:hover .portal-product-img {
    transform: scale(1.04);
}

.portal-product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-subdued);
    background: linear-gradient(145deg, #f5f5f5, #fafafa);
}

.portal-product-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px 16px;
    min-height: 0;
    height: 100%;
    flex: 1;
}

.portal-product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-subdued);
}

.portal-product-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.portal-product-sku,
.portal-product-desc {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--text-subdued);
}

.portal-product-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portal-product-stock-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin-top: 2px;
}

.portal-product-stock-row--winding {
    animation: portal-stock-row-wind 440ms cubic-bezier(0.22, 1, 0.36, 1);
}

.portal-product-stock-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 2px color-mix(in srgb, #16a34a 22%, transparent);
}

.portal-product-stock-dot--ok {
    background: #16a34a;
    box-shadow: 0 0 0 2px color-mix(in srgb, #16a34a 22%, transparent);
}

.portal-product-stock-dot--low {
    background: #ea580c;
    box-shadow: 0 0 0 2px color-mix(in srgb, #ea580c 22%, transparent);
}

.portal-product-stock-dot--out {
    background: #dc2626;
    box-shadow: 0 0 0 2px color-mix(in srgb, #dc2626 22%, transparent);
}

.portal-product-stock-label {
    font-size: 0.8125rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-subdued);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes portal-stock-row-wind {
    0% {
        transform: translateY(0) scale(1);
        filter: brightness(1);
    }
    34% {
        transform: translateY(-1px) scale(1.03);
        filter: brightness(1.06);
    }
    100% {
        transform: translateY(0) scale(1);
        filter: brightness(1);
    }
}

.portal-product-price-slot {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    min-width: 0;
    margin-top: 2px;
}

.portal-product-price-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
}

.portal-product-price-vat {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-subdued);
    width: 100%;
    line-height: 1.2;
}

.portal-product-retail {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-subdued);
    text-decoration: line-through;
    white-space: nowrap;
}

.portal-product-cta-sep {
    height: 1px;
    margin-top: auto;
    margin-bottom: 0;
    background: var(--border-subdued);
    flex-shrink: 0;
}

.portal-product-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    min-width: 0;
    margin-top: 0;
}

.portal-product-cta-wrap {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
}

.portal-product-cta-wrap .portal-product-cta {
    width: 100%;
    flex: 1 1 auto;
}

.portal-product-cta {
    --btn-ease: cubic-bezier(0.22, 1, 0.36, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    margin-top: 0;
    padding: 11px 14px;
    background: linear-gradient(165deg, #2a2a2a 0%, #1a1a1a 55%, #0a0a0a 100%);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    box-shadow:
        0 0 0 1px rgba(10, 10, 10, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1),
        0 3px 12px rgba(10, 10, 10, 0.12);
    transition:
        box-shadow 0.4s var(--btn-ease),
        transform 0.35s var(--btn-ease),
        filter 0.35s var(--btn-ease),
        opacity 0.3s var(--btn-ease);
}

.portal-product-cta:hover:not(:disabled) {
    box-shadow:
        0 0 0 1px rgba(10, 10, 10, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.08),
        0 8px 20px rgba(10, 10, 10, 0.18);
    transform: translateY(-1.5px);
    filter: brightness(1.06);
    color: #fff;
    background: linear-gradient(165deg, #333 0%, #1a1a1a 55%, #0a0a0a 100%);
}

.portal-product-cta:active:not(:disabled) {
    transform: translateY(0) scale(0.985);
    filter: brightness(0.97);
}

.portal-product-cta:disabled {
    background: color-mix(in srgb, var(--text-subdued) 88%, #fff);
    color: #fff;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
    filter: none;
    opacity: 1;
}

.portal-product-cta-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 2px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.48);
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

/* Shared portal tooltips (floating; expand from center like product CTAs) */
.portal-tooltip {
    --x: 0px;
    --y: 0px;
    position: fixed;
    top: var(--y);
    left: var(--x);
    z-index: 10060;
    width: max-content;
    max-width: min(230px, calc(100vw - 16px));
    pointer-events: none;
    transform: translate(-50%, calc(-100% - 0px));
}

.portal-tooltip.is-bottom {
    transform: translate(-50%, 0);
}

.portal-tooltip__bubble {
    display: block;
    box-sizing: border-box;
    width: 18px;
    min-width: 18px;
    max-width: min(230px, calc(100vw - 16px));
    margin: 0 auto;
    padding: 8px 10px;
    border-radius: 10px;
    background: #101012;
    color: transparent;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.portal-tooltip__arrow {
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 8px;
    height: 8px;
    margin-left: -4px;
    background: #101012;
    transform: rotate(45deg);
    opacity: 0;
}

.portal-tooltip.is-bottom .portal-tooltip__arrow {
    top: -4px;
    bottom: auto;
}

.portal-tooltip.is-open .portal-tooltip__arrow {
    opacity: 1;
}

/* Off-DOM measurement for final expanded width */
.portal-tooltip__probe {
    position: fixed;
    left: -9999px;
    top: 0;
    box-sizing: border-box;
    width: max-content;
    max-width: min(230px, calc(100vw - 16px));
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
    visibility: hidden;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .portal-tooltip__bubble {
        transition: none !important;
    }
}

.portal-product-cta .portal-product-cta-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.portal-product-cta-box {
    flex: 0 0 auto;
    width: auto;
    aspect-ratio: 1;
    align-self: stretch;
    padding: 0;
    min-width: 0;
    letter-spacing: 0.02em;
    font-weight: 700;
}

@media (max-width: 768px) {
    .portal-product-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .portal-product-card {
        grid-template-columns: 96px minmax(0, 1fr);
        grid-template-rows: auto;
        align-items: stretch;
        height: auto;
    }

    .portal-product-card:hover {
        transform: none;
    }

    .portal-product-card[hidden] {
        display: none !important;
    }

    .portal-product-media {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 96px;
        height: auto;
        min-height: 96px;
        aspect-ratio: auto;
        align-self: stretch;
        background: #f7f7f7;
    }

    .portal-product-media-frame {
        width: 100%;
        height: 96px;
        max-height: 96px;
        flex: 0 0 96px;
        padding: 6px;
    }

    .portal-product-img {
        object-fit: contain;
        object-position: center;
    }

    .portal-product-card:hover .portal-product-img {
        transform: none;
    }

    .portal-product-body {
        gap: 3px;
        padding: 8px 10px 10px;
        height: auto;
    }

    .portal-product-meta {
        gap: 6px;
        font-size: 0.625rem;
    }

    .portal-product-name {
        font-size: 0.875rem;
        line-height: 1.25;
        -webkit-line-clamp: 2;
    }

    .portal-product-sku {
        display: none;
    }

    .portal-product-stock-row {
        margin-top: 0;
    }

    .portal-product-stock-label {
        font-size: 0.75rem;
    }

    .portal-product-price-slot {
        gap: 6px;
        margin-top: 0;
    }

    .portal-product-price-value {
        font-size: 0.9375rem;
    }

    .portal-product-price-vat {
        width: auto;
        font-size: 0.6875rem;
    }

    .portal-product-cta-sep {
        display: none;
    }

    .portal-product-actions {
        margin-top: 6px;
    }

    .portal-product-cta {
        padding: 8px 10px;
        font-size: 0.8125rem;
        border-radius: 10px;
        gap: 6px;
    }

    .portal-product-cta .portal-product-cta-icon {
        width: 16px;
        height: 16px;
    }
}

.portal-header-cart {
    position: relative;
    text-decoration: none;
    gap: 0;
    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease,
        padding 0.2s ease,
        gap 0.2s ease,
        min-width 0.2s ease;
}

.portal-header-cart--filled,
.header-icon-btn.portal-header-cart--filled {
    width: auto;
    min-width: var(--header-control-size);
    padding: 0 10px 0 12px;
    gap: 8px;
    justify-content: flex-start;
    color: var(--text-primary);
}

.portal-header-cart--active,
.header-icon-btn.portal-header-cart--active {
    background: linear-gradient(180deg, #232327 0%, #131315 60%, #0e0e10 100%);
    color: #fff;
    border-color: rgba(16, 16, 18, 0.9);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 1px 2px rgba(16, 16, 18, 0.2),
        0 8px 20px rgba(16, 16, 18, 0.16);
}

.portal-header-cart--active:hover,
.header-icon-btn.portal-header-cart--active:hover {
    background: linear-gradient(180deg, #2b2b30 0%, #1a1a1e 60%, #131315 100%);
    color: #fff;
    border-color: rgba(16, 16, 18, 0.9);
}

.portal-header-cart--active .portal-header-cart-total {
    color: #fff;
}

.portal-header-cart--active .portal-header-cart-count {
    background: #fff;
    color: #101012;
}

.portal-header-cart-meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    white-space: nowrap;
}

.portal-header-cart-meta[hidden] {
    display: none !important;
}

.portal-header-cart-total {
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.portal-header-cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.portal-cart-badge {
    position: absolute;
    top: -1px;
    right: -1px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

@media (max-width: 720px) {
    .portal-header-cart--filled {
        padding: 0 8px 0 10px;
        gap: 6px;
    }

    .portal-header-cart-total {
        font-size: 0.75rem;
    }
}

.portal-cart-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1200;
    max-width: min(320px, calc(100vw - 32px));
    padding: 13px 18px;
    border-radius: 14px;
    background:
        radial-gradient(400px 120px at 100% 0%, rgba(255, 255, 255, 0.08), transparent 60%),
        linear-gradient(150deg, #1c1c20 0%, #101012 100%);
    border: 1px solid rgba(16, 16, 18, 0.9);
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 12px 32px rgba(16, 16, 18, 0.28);
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.portal-cart-toast--visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.portal-cart-toast::before {
    content: "✓ ";
    color: #6ee7a0;
    font-weight: 700;
}

.portal-cart-toast--delight::after {
    content: "";
    position: absolute;
    inset: -32px;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 32%, rgba(110, 231, 160, 0.85) 0 2px, transparent 3px),
        radial-gradient(circle at 42% 18%, rgba(255, 255, 255, 0.82) 0 1.8px, transparent 3px),
        radial-gradient(circle at 64% 30%, rgba(255, 223, 128, 0.85) 0 2px, transparent 3px),
        radial-gradient(circle at 80% 44%, rgba(153, 204, 255, 0.85) 0 1.8px, transparent 3px),
        radial-gradient(circle at 36% 72%, rgba(255, 255, 255, 0.8) 0 1.8px, transparent 3px);
    opacity: 0;
    animation: portal-toast-sparkle 0.6s ease-out;
}

.portal-order-success-pop {
    animation: portal-order-success-pop 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes portal-empty-state-rise {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes portal-empty-icon-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

@keyframes portal-toast-sparkle {
    0% {
        opacity: 0;
        transform: scale(0.92);
    }
    30% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: scale(1.03);
    }
}

@keyframes portal-order-success-pop {
    0% {
        transform: translateY(6px) scale(0.985);
        opacity: 0;
    }
    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.portal-product-fly-ghost {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 10050;
    pointer-events: none;
    transform-origin: center center;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.portal-product-fly-ghost__inner {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 28px rgba(16, 16, 18, 0.22);
    border: 1px solid rgba(16, 16, 18, 0.08);
}

.portal-product-fly-ghost__inner--fallback {
    background: linear-gradient(145deg, #f4f4f5, #e4e4e7);
}

.portal-product-fly-ghost__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

#portalCartBtn.portal-cart-btn--pulse,
.portal-header-cart.portal-cart-btn--pulse {
    animation: portalCartBtnPulse 0.62s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes portalCartBtnPulse {
    0% { transform: scale(1); }
    35% { transform: scale(1.22); }
    65% { transform: scale(0.94); }
    100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .portal-product-fly-ghost {
        display: none !important;
    }

    #portalCartBtn.portal-cart-btn--pulse,
    .portal-header-cart.portal-cart-btn--pulse {
        animation: none;
    }
}

.portal-cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
    gap: 24px;
    align-items: start;
}

/* display:grid above beats UA [hidden] without !important in some browsers */
.portal-cart-layout[hidden] {
    display: none !important;
}

.portal-cart-main {
    min-width: 0;
}

.portal-cart-panel {
    margin-bottom: 0;
    padding: 0;
    overflow: hidden;
}

.portal-cart-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 18px;
    border-bottom: 1px solid var(--border-subdued);
}

.portal-cart-panel-title {
    margin: 0 0 4px;
    font-size: 1.0625rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.portal-cart-panel-meta {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-subdued);
}

.portal-cart-continue {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 0.8125rem;
    font-weight: 550;
    color: var(--text-subdued);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.portal-cart-continue:hover {
    color: var(--text-primary);
    border-bottom-color: rgba(16, 16, 18, 0.28);
}

.portal-cart-lines {
    display: flex;
    flex-direction: column;
}

.portal-cart-line {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto auto 40px;
    gap: 16px;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subdued);
    transition: background 0.15s ease;
    transform-origin: left center;
}

.portal-cart-line:last-child {
    border-bottom: none;
}

.portal-cart-line:hover {
    background: rgba(16, 16, 18, 0.015);
}

.portal-cart-line--exit {
    animation: portal-cart-line-exit 320ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none !important;
    background: transparent !important;
}

.portal-cart-lines.is-clearing {
    pointer-events: none;
}

@keyframes portal-cart-line-exit {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
        max-height: 140px;
        margin-top: 0;
        margin-bottom: 0;
        padding-top: 18px;
        padding-bottom: 18px;
    }
    55% {
        opacity: 0;
        transform: translateX(-36px) scale(0.98);
    }
    100% {
        opacity: 0;
        transform: translateX(-56px) scale(0.96);
        max-height: 0;
        margin-top: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
        border-bottom-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-cart-line--exit {
        animation: none !important;
    }
}

.portal-cart-line-thumb {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    border: 1px solid var(--border-subdued);
    background:
        linear-gradient(180deg, #ffffff 0%, #f7f7f8 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.portal-cart-line-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.portal-cart-line-thumb--empty {
    color: var(--text-subdued);
    background: var(--bg-secondary);
}

.portal-cart-line-info {
    min-width: 0;
}

.portal-cart-line-name {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--text-primary);
    line-height: 1.3;
}

.portal-cart-line-sku {
    margin-top: 3px;
    font-size: 0.75rem;
    color: var(--text-subdued);
}

.portal-cart-line-unit {
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--text-subdued);
    font-variant-numeric: tabular-nums;
}

.portal-qty-stepper {
    display: inline-flex;
    align-items: stretch;
    height: 40px;
    border: 1px solid rgba(16, 16, 18, 0.12);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 1px 2px rgba(16, 16, 18, 0.04);
}

.portal-qty-btn {
    width: 36px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    transition: background 0.12s ease;
}

.portal-qty-btn:hover {
    background: rgba(16, 16, 18, 0.04);
}

.portal-qty-btn:active {
    background: rgba(16, 16, 18, 0.08);
}

.portal-cart-qty-input {
    width: 48px;
    height: 100%;
    margin: 0;
    padding: 0 2px;
    border: none !important;
    border-left: 1px solid rgba(16, 16, 18, 0.08) !important;
    border-right: 1px solid rgba(16, 16, 18, 0.08) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    background: transparent;
    transition: color 0.2s ease, transform 0.2s ease;
    -moz-appearance: textfield;
}

.portal-cart-line--winding .portal-cart-qty-input,
.portal-cart-line--winding .portal-cart-line-total strong {
    animation: portal-cart-qty-wind 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes portal-cart-qty-wind {
    0% {
        transform: translateY(0) scale(1);
        filter: brightness(1);
    }
    35% {
        transform: translateY(-1px) scale(1.04);
        filter: brightness(1.05);
    }
    100% {
        transform: translateY(0) scale(1);
        filter: brightness(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-cart-line--winding .portal-cart-qty-input,
    .portal-cart-line--winding .portal-cart-line-total strong {
        animation: none !important;
    }
}

.portal-cart-qty-input::-webkit-outer-spin-button,
.portal-cart-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.portal-cart-qty-input:focus {
    outline: none;
    background: rgba(16, 16, 18, 0.02);
}

.portal-cart-line-total {
    min-width: 96px;
    text-align: right;
    font-size: 0.9375rem;
}

.portal-cart-line-total strong {
    font-weight: 650;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.portal-cart-line .portal-remove-row {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--text-subdued);
}

.portal-cart-syrup-note {
    margin: 0;
    padding: 14px 24px;
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--border-subdued);
    font-size: 0.8125rem;
    line-height: 1.4;
}

.portal-cart-syrup-note--ok {
    background: var(--success-soft);
    color: var(--success);
}

.portal-cart-syrup-note--warn {
    background: var(--warning-soft);
    color: var(--warning);
}

.portal-cart-summary {
    position: sticky;
    top: 88px;
    padding: 22px;
    margin-bottom: 0;
}

.portal-cart-summary-title {
    margin: 0 0 18px;
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.portal-cart-summary-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.portal-cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 0.875rem;
    color: var(--text-subdued);
}

.portal-cart-summary-row span:last-child {
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.portal-cart-summary-row--total {
    padding-top: 14px;
    border-top: 1px solid var(--border-subdued);
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 550;
}

.portal-cart-summary-row--total strong {
    font-size: 1.25rem;
    font-weight: 650;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.portal-cart-summary-delivery {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 0 4px;
    border-top: 1px solid var(--border-subdued);
    margin-bottom: 18px;
}

.portal-cart-summary-subtitle {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.portal-cart-address {
    resize: vertical;
    min-height: 72px;
    line-height: 1.4;
}

.portal-cart-summary-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.portal-cart-summary-actions .btn-block,
.portal-cart-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.portal-cart-action-btn .portal-icon-wrap,
.portal-cart-action-btn .portal-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Signature Place Order CTA — idle autoplay */
.portal-place-order-btn {
    --place-ease: cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 52px;
    padding: 14px 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    color: #fff;
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    background:
        radial-gradient(120% 140% at 12% 0%, rgba(255, 255, 255, 0.18) 0%, transparent 42%),
        linear-gradient(180deg, #2f2f35 0%, #17171a 48%, #101012 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        inset 0 -1px 0 rgba(0, 0, 0, 0.28),
        0 1px 2px rgba(16, 16, 18, 0.28),
        0 10px 28px rgba(16, 16, 18, 0.22);
    transform: translateZ(0);
    animation: portal-place-order-breathe 3.4s var(--place-ease) infinite;
    transition:
        transform 0.22s var(--place-ease),
        box-shadow 0.22s ease,
        filter 0.22s ease;
}

.portal-place-order-btn__glow,
.portal-place-order-btn__sheen,
.portal-place-order-btn__content {
    pointer-events: none;
}

.portal-place-order-btn__glow {
    position: absolute;
    inset: -40%;
    z-index: 0;
    background:
        radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.16) 0%, transparent 34%),
        radial-gradient(circle at 72% 60%, rgba(255, 214, 170, 0.12) 0%, transparent 30%);
    opacity: 0.55;
    animation: portal-place-order-glow 4.8s ease-in-out infinite;
}

.portal-place-order-btn__sheen {
    position: absolute;
    top: -20%;
    left: -45%;
    z-index: 1;
    width: 42%;
    height: 140%;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(255, 255, 255, 0.04) 35%,
        rgba(255, 255, 255, 0.34) 50%,
        rgba(255, 255, 255, 0.04) 65%,
        transparent 100%
    );
    transform: translateX(-120%) skewX(-18deg);
    animation: portal-place-order-sheen 3.8s var(--place-ease) infinite;
}

.portal-place-order-btn__content {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.portal-place-order-btn__label {
    display: inline-block;
    animation: portal-place-order-label 3.4s var(--place-ease) infinite;
}

.portal-place-order-btn__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
    animation: portal-place-order-icon 3.4s var(--place-ease) infinite;
}

.portal-place-order-btn__icon .portal-icon-wrap,
.portal-place-order-btn__icon .portal-icon {
    width: 15px;
    height: 15px;
}

.portal-place-order-btn:hover {
    filter: brightness(1.06);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 -1px 0 rgba(0, 0, 0, 0.28),
        0 2px 4px rgba(16, 16, 18, 0.28),
        0 14px 34px rgba(16, 16, 18, 0.28);
    animation-play-state: paused;
}

.portal-place-order-btn:hover .portal-place-order-btn__sheen,
.portal-place-order-btn:hover .portal-place-order-btn__glow,
.portal-place-order-btn:hover .portal-place-order-btn__label,
.portal-place-order-btn:hover .portal-place-order-btn__icon {
    animation-play-state: paused;
}

.portal-place-order-btn:hover .portal-place-order-btn__sheen {
    transform: translateX(260%) skewX(-18deg);
    transition: transform 0.7s var(--place-ease);
}

.portal-place-order-btn:active {
    transform: translateY(1px) scale(0.985);
    filter: brightness(0.98);
}

.portal-place-order-btn:focus-visible {
    outline: 2px solid rgba(16, 16, 18, 0.55);
    outline-offset: 3px;
}

@keyframes portal-place-order-breathe {
    0%,
    100% {
        transform: translateY(0) scale(1);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.16),
            inset 0 -1px 0 rgba(0, 0, 0, 0.28),
            0 1px 2px rgba(16, 16, 18, 0.28),
            0 10px 28px rgba(16, 16, 18, 0.22);
    }
    50% {
        transform: translateY(-1px) scale(1.015);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.2),
            inset 0 -1px 0 rgba(0, 0, 0, 0.28),
            0 2px 6px rgba(16, 16, 18, 0.28),
            0 16px 36px rgba(16, 16, 18, 0.3);
    }
}

@keyframes portal-place-order-sheen {
    0%,
    18% {
        transform: translateX(-140%) skewX(-18deg);
        opacity: 0;
    }
    28% {
        opacity: 1;
    }
    58% {
        transform: translateX(260%) skewX(-18deg);
        opacity: 0.85;
    }
    70%,
    100% {
        transform: translateX(260%) skewX(-18deg);
        opacity: 0;
    }
}

@keyframes portal-place-order-glow {
    0%,
    100% {
        opacity: 0.35;
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        opacity: 0.75;
        transform: translate3d(2%, -2%, 0) scale(1.06);
    }
}

@keyframes portal-place-order-label {
    0%,
    100% {
        letter-spacing: 0.01em;
        opacity: 1;
    }
    50% {
        letter-spacing: 0.03em;
        opacity: 0.96;
    }
}

@keyframes portal-place-order-icon {
    0%,
    100% {
        transform: scale(1) rotate(0deg);
        background: rgba(255, 255, 255, 0.12);
    }
    40% {
        transform: scale(1.08) rotate(-4deg);
        background: rgba(255, 255, 255, 0.18);
    }
    55% {
        transform: scale(1.04) rotate(3deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-place-order-btn,
    .portal-place-order-btn__glow,
    .portal-place-order-btn__sheen,
    .portal-place-order-btn__label,
    .portal-place-order-btn__icon {
        animation: none !important;
    }

    .portal-place-order-btn:hover .portal-place-order-btn__sheen {
        transition: none;
        transform: none;
    }
}

.portal-cart-empty {
    position: relative;
    overflow: hidden;
    margin: 8px 0 0;
    padding: 56px 28px 40px;
    border-radius: 22px;
    border: 1px solid var(--border-subdued);
    background: var(--bg-card);
    box-shadow: var(--shadow-raised);
    text-align: center;
    animation: portal-empty-state-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.portal-cart-empty__glow {
    position: absolute;
    inset: -20% -10% auto;
    height: 70%;
    background:
        radial-gradient(ellipse 55% 60% at 50% 0%, color-mix(in srgb, var(--text) 10%, transparent), transparent 70%),
        radial-gradient(ellipse 40% 50% at 18% 30%, color-mix(in srgb, var(--text) 5%, transparent), transparent 65%),
        radial-gradient(ellipse 36% 46% at 82% 24%, color-mix(in srgb, var(--text) 4%, transparent), transparent 65%);
    pointer-events: none;
}

.portal-cart-empty__inner {
    position: relative;
    z-index: 1;
    max-width: 560px;
    margin: 0 auto;
}

.portal-cart-empty__visual {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 22px;
    display: grid;
    place-items: center;
}

.portal-cart-empty__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid color-mix(in srgb, var(--text) 32%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 6%, transparent);
    animation: portal-cart-empty-ring 3.6s ease-out infinite;
}

.portal-cart-empty__ring--delayed {
    animation-delay: 1.2s;
}

.portal-cart-empty__icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(165deg, #2a2a2e 0%, #101012 72%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 10px 28px -12px rgba(16, 16, 18, 0.55);
}

[data-theme="dark"] .portal-cart-empty__icon {
    color: #101012;
    background: linear-gradient(165deg, #f7f7f8 0%, #e8e8ea 72%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        0 10px 28px -12px rgba(0, 0, 0, 0.55);
}

.portal-cart-empty__icon .portal-icon {
    width: 30px;
    height: 30px;
}

.portal-cart-empty__kicker {
    margin: 0 0 8px;
    font-size: 0.75rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-subdued);
}

.portal-cart-empty__title {
    margin: 0 0 10px;
    font-size: clamp(1.45rem, 2.4vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.15;
    color: var(--text-primary);
}

.portal-cart-empty__desc {
    margin: 0 auto 24px;
    max-width: 34ch;
    color: var(--text-subdued);
    font-size: 0.98rem;
    line-height: 1.5;
}

.portal-cart-empty__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.portal-cart-empty__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding-inline: 18px;
}

.portal-cart-empty__cta .portal-icon-wrap {
    display: inline-flex;
}

.portal-cart-empty__tips {
    list-style: none;
    margin: 0;
    padding: 20px 0 0;
    border-top: 1px solid var(--divider);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px 18px;
    text-align: left;
}

.portal-cart-empty__tips li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--text-subdued);
    opacity: 0;
    transform: translateY(6px);
    animation: portal-cart-empty-tip-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.portal-cart-empty__tips li:nth-child(1) { animation-delay: 0.12s; }
.portal-cart-empty__tips li:nth-child(2) { animation-delay: 0.2s; }
.portal-cart-empty__tips li:nth-child(3) { animation-delay: 0.28s; }

.portal-cart-empty__tip-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--text-primary);
}

.portal-cart-empty__tip-icon .portal-icon {
    width: 14px;
    height: 14px;
}

@keyframes portal-cart-empty-ring {
    0% {
        transform: scale(0.78);
        opacity: 0.85;
    }
    70% {
        opacity: 0.28;
    }
    100% {
        transform: scale(1.32);
        opacity: 0;
    }
}

@keyframes portal-cart-empty-tip-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 720px) {
    .portal-cart-empty {
        padding: 44px 18px 28px;
        border-radius: 18px;
    }

    .portal-cart-empty__tips {
        grid-template-columns: 1fr;
        gap: 12px;
        text-align: left;
    }

    .portal-cart-empty__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-cart-empty__cta {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-cart-empty,
    .portal-cart-empty__ring,
    .portal-cart-empty__tips li {
        animation: none !important;
        opacity: 1;
        transform: none;
    }
}

.portal-cart-page-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--divider);
}

a.portal-btn-disabled,
a.portal-btn-disabled:hover,
button.portal-btn-disabled,
button.portal-btn-disabled:hover {
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
}

/* ── Checkout flow ── */

.portal-checkout-stepper {
    margin: 0 0 24px;
}

.portal-checkout-steps {
    display: flex;
    align-items: stretch;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.portal-checkout-step {
    display: flex;
    align-items: center;
    flex: 1 1 0;
    min-width: 0;
}

.portal-checkout-step-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    color: var(--text-subdued);
    font-size: 0.8125rem;
    font-weight: 550;
    letter-spacing: -0.01em;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.portal-checkout-step-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(16, 16, 18, 0.06);
    color: inherit;
    font-size: 0.75rem;
    font-weight: 650;
    flex-shrink: 0;
}

.portal-checkout-step.is-current .portal-checkout-step-pill {
    background: linear-gradient(180deg, #232327 0%, #131315 60%, #0e0e10 100%);
    color: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 4px 14px rgba(16, 16, 18, 0.16);
}

.portal-checkout-step.is-current .portal-checkout-step-marker {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.portal-checkout-step.is-done .portal-checkout-step-pill {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-subdued);
}

.portal-checkout-step.is-done .portal-checkout-step-marker {
    background: linear-gradient(180deg, #1d1d21 0%, #101012 100%);
    color: #fff;
}

.portal-checkout-step.is-done .portal-checkout-step-pill:hover {
    background: #fff;
    border-color: var(--border-strong);
}

.portal-checkout-step.has-connector::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    margin: 0 8px;
    min-width: 16px;
    background: linear-gradient(90deg, rgba(16, 16, 18, 0.12), rgba(16, 16, 18, 0.04));
}

.portal-checkout-step.is-done.has-connector::after,
.portal-checkout-step.is-current.has-connector::after {
    background: linear-gradient(90deg, rgba(16, 16, 18, 0.28), rgba(16, 16, 18, 0.08));
}

.portal-checkout-panel {
    margin-bottom: 0;
    padding: 0;
    overflow: hidden;
}

.portal-checkout-panel-head {
    padding: 22px 24px 8px;
}

.portal-checkout-form {
    padding: 8px 24px 24px;
}

.portal-checkout-section {
    margin-bottom: 22px;
}

.portal-checkout-section-title {
    margin: 0 0 14px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.portal-checkout-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.portal-checkout-address-fields,
.portal-checkout-company-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.portal-checkout-address-fields[hidden] {
    display: none !important;
}
.portal-checkout-address-fields.is-editing-new {
    margin-top: 4px;
}
.portal-checkout-address-book {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.portal-checkout-address-selected {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border-subdued);
    border-radius: 14px;
    background: linear-gradient(180deg, #fafafa 0%, #f6f6f7 100%);
}
.portal-checkout-address-selected[hidden] {
    display: none !important;
}
.portal-checkout-address-selected.is-latest {
    border-color: color-mix(in srgb, #101012 22%, var(--border-subdued));
}
.portal-checkout-address-selected__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 220px;
}
.portal-checkout-address-selected__badge {
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 700;
    color: #101012;
}
.portal-checkout-address-selected__line {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}
.portal-checkout-address-selected__meta {
    font-size: 0.84rem;
    color: var(--text-secondary);
}
.portal-checkout-address-selected__actions {
    display: flex;
    align-items: center;
}
.portal-checkout-address-picker {
    padding: 14px 16px;
    border: 1px dashed var(--border-subdued);
    border-radius: 14px;
    background: #fff;
}
.portal-checkout-address-picker[hidden] {
    display: none !important;
}
.portal-checkout-address-picker__title {
    margin: 0 0 12px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}
.portal-checkout-address-picker__list {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}
.portal-checkout-address-option {
    appearance: none;
    width: 100%;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--border-subdued);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.portal-checkout-address-option:hover {
    border-color: color-mix(in srgb, #101012 28%, var(--border-subdued));
}
.portal-checkout-address-option.is-selected {
    border-color: #101012;
    box-shadow: 0 0 0 1px rgba(16, 16, 18, 0.18);
}
.portal-checkout-address-option__title {
    font-size: 0.92rem;
    font-weight: 650;
    color: var(--text-primary);
}
.portal-checkout-address-option__detail {
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.35;
}
.portal-checkout-address-option__badge {
    font-size: 0.72rem;
    font-weight: 700;
    color: #101012;
}
.portal-checkout-address-picker__actions,
.portal-checkout-address-new-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.portal-checkout-address-picker__actions {
    justify-content: flex-end;
}
.portal-checkout-address-new-toolbar[hidden] {
    display: none !important;
}

.portal-checkout-required-mark {
    color: var(--error);
    font-weight: 600;
}

.portal-checkout-address-block {
    margin-bottom: 18px;
}

.portal-checkout-address-title {
    margin: 0 0 10px;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.portal-checkout-toggle {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0 18px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-subdued);
    background: linear-gradient(180deg, #fafafa 0%, #f6f6f7 100%);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.35;
}

.portal-checkout-toggle input {
    margin-top: 2px;
    accent-color: #101012;
    flex-shrink: 0;
}

.portal-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.portal-checkout-address-review {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.portal-checkout-address-review-label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-subdued);
}

.portal-checkout-ship-card {
    margin: 8px 24px 20px;
    padding: 16px 18px;
    border-radius: 14px;
    background: linear-gradient(180deg, #fafafa 0%, #f5f5f6 100%);
    border: 1px solid var(--border-subdued);
}

.portal-checkout-ship-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 0.8125rem;
}

.portal-checkout-ship-address {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: var(--text-primary);
}

.portal-checkout-fieldset-legend {
    margin: 0 0 12px;
    padding: 0 24px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.portal-payment-methods {
    margin: 0;
    padding: 0 24px 24px;
    border: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.portal-payment-option {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--border-subdued);
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.portal-payment-option:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-card);
}

.portal-payment-option:has(input:checked) {
    border-color: rgba(16, 16, 18, 0.55);
    background: linear-gradient(180deg, #fafafa 0%, #f7f7f8 100%);
    box-shadow:
        inset 0 0 0 1px rgba(16, 16, 18, 0.06),
        var(--shadow-card);
}

.portal-payment-option input {
    margin-top: 3px;
    accent-color: #101012;
    flex-shrink: 0;
}

.portal-payment-option-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.portal-payment-option-title {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--text-primary);
}

.portal-payment-option-desc {
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--text-subdued);
}

.portal-payment-option:has(input:disabled) {
    opacity: 0.55;
    cursor: not-allowed;
}

.portal-stripe-wrap {
    margin: 0 24px 24px;
    padding: 18px;
    border-radius: 14px;
    border: 1px solid var(--border-subdued);
    background: #fff;
}

.portal-stripe-element {
    min-height: 48px;
}

.portal-stripe-status {
    margin: 12px 0 0;
    font-size: 0.8125rem;
    color: var(--text-subdued);
}

.portal-stripe-wrap .alert-banner {
    margin-top: 12px;
}

.portal-stripe-warn {
    margin: 0 24px 16px;
}

#portalPaymentForm.is-card-payment-busy .portal-payment-option {
    pointer-events: none;
}

#portalPaymentBack.is-disabled {
    pointer-events: none;
    opacity: 0.55;
}

#portalCardPayBtn.is-loading {
    opacity: 0.85;
}

.portal-checkout-complete {
    max-width: 520px;
    margin: 0 auto;
}

.portal-checkout-complete-body {
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
}

.portal-checkout-complete-status {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.portal-cart-summary-row--discount span:last-child {
    color: var(--success);
    font-weight: 550;
}

.portal-cart-summary-row--vat span:last-child {
    color: var(--text-primary);
    font-weight: 550;
}

@media (max-width: 900px) {
    .portal-checkout-step.has-connector::after {
        min-width: 10px;
        margin: 0 4px;
    }

    .portal-checkout-step-label {
        display: none;
    }

    .portal-checkout-step.is-current .portal-checkout-step-label {
        display: inline;
    }

    .portal-checkout-panel-head,
    .portal-checkout-form,
    .portal-payment-methods {
        padding-left: 18px;
        padding-right: 18px;
    }

    .portal-stripe-wrap,
    .portal-stripe-warn {
        margin-left: 18px;
        margin-right: 18px;
    }

    .portal-checkout-ship-card {
        margin-left: 18px;
        margin-right: 18px;
    }

    .portal-checkout-address-review {
        grid-template-columns: 1fr;
    }

    .portal-checkout-form-row {
        grid-template-columns: 1fr;
    }

    .portal-checkout-fieldset-legend {
        padding-left: 18px;
        padding-right: 18px;
    }
}

.portal-mini-stat {
    text-align: left;
    padding: 20px 20px 18px;
}

.portal-mini-stat-value {
    font-size: 1.625rem;
    font-weight: 650;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.03em;
}

.portal-mini-stat-label {
    font-size: 0.8125rem;
    color: var(--text-subdued);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
}

.portal-form-section {
    padding-top: 20px;
    border-top: 1px solid var(--divider);
}

.portal-form-section:first-child {
    padding-top: 0;
    border-top: none;
}

.portal-form-section-title {
    margin: 0 0 14px;
    font-size: 0.9375rem;
    font-weight: 600;
}

.portal-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.portal-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-subdued);
}

.portal-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.portal-remove-row {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-subdued);
    border-radius: var(--radius-control);
    background: var(--surface-card);
    color: var(--text-subdued);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.portal-remove-row .portal-icon-wrap,
.portal-remove-row .portal-icon {
    width: 15px;
    height: 15px;
}

.portal-remove-row:hover {
    background: var(--error-soft);
    border-color: color-mix(in srgb, var(--error) 25%, transparent);
    color: var(--error);
}

.portal-order-total-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--divider);
    font-size: 0.9375rem;
}

.portal-order-preview {
    position: sticky;
    top: 88px;
}

.portal-preview-partner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-control);
    margin-bottom: 16px;
}

.portal-preview-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.portal-preview-name {
    font-weight: 600;
}

.portal-preview-sub {
    font-size: 0.8125rem;
    color: var(--text-subdued);
}

.portal-preview-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 80px;
    margin-bottom: 16px;
}

.portal-preview-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--divider);
    font-size: 0.875rem;
}

.portal-preview-empty {
    color: var(--text-subdued);
    font-size: 0.875rem;
    font-style: italic;
}

.portal-preview-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--divider);
}

.portal-order-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 20px;
}

.portal-detail-title {
    margin: 0 0 12px;
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-subdued);
}

.portal-detail-list {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.portal-detail-list > div {
    margin: 0;
}

.portal-detail-list dt {
    font-size: 0.71875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-subdued);
    margin-bottom: 4px;
}

.portal-detail-list dd {
    margin: 0;
    font-size: 0.9375rem;
    font-weight: 550;
    color: var(--text-primary);
    line-height: 1.4;
}

.portal-order-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.portal-order-summary--modal {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 18px;
}

.portal-order-summary-stat {
    text-align: center;
    padding: 14px 12px;
    background: color-mix(in srgb, var(--surface) 65%, #fff);
    border: 1px solid var(--border-subdued);
    border-radius: 14px;
}

.portal-order-summary-stat--total {
    background: linear-gradient(180deg, #232327 0%, #131315 100%);
    border-color: rgba(16, 16, 18, 0.9);
    color: #fff;
}

.portal-order-summary-stat--total .portal-order-summary-value,
.portal-order-summary-stat--total .portal-order-summary-label {
    color: #fff;
}

.portal-order-summary-stat--total .portal-order-summary-label {
    opacity: 0.72;
}

.portal-order-summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
}

.portal-order-summary-label {
    margin-top: 4px;
    font-size: 0.6875rem;
    font-weight: 650;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-subdued);
}

.portal-order-modal {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.portal-order-modal-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: -4px 0 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subdued);
}

.portal-order-modal-kicker {
    margin: 0 0 4px;
    font-size: 0.6875rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-subdued);
}

.portal-order-modal-number {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.portal-order-modal-date {
    margin: 6px 0 0;
    font-size: 0.875rem;
    color: var(--text-subdued);
}

.portal-order-modal-hero-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.portal-order-modal-panel {
    padding: 14px 16px;
    border: 1px solid var(--border-subdued);
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface) 55%, #fff);
}

.portal-order-modal-address {
    white-space: pre-wrap;
    word-break: break-word;
}

.portal-order-modal-items-section {
    margin-top: 4px;
}

.portal-order-modal-docs-section {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--divider);
}

.portal-order-docs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.portal-order-doc-link {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border-subdued);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 70%, #fff);
    color: inherit;
    text-decoration: none;
    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.portal-order-doc-link:hover {
    border-color: var(--border-strong);
    background: #fff;
    transform: translateY(-1px);
}

.portal-order-doc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #101012;
    color: #fff;
}

.portal-order-doc-icon .portal-icon-wrap,
.portal-order-doc-icon .portal-icon {
    width: 16px;
    height: 16px;
}

.portal-order-doc-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.portal-order-doc-label {
    font-size: 0.9375rem;
    font-weight: 650;
    color: var(--text-primary);
}

.portal-order-doc-meta {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-subdued);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portal-order-doc-action {
    font-size: 0.8125rem;
    font-weight: 650;
    color: var(--text-primary);
}

.portal-order-docs-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-primary) 8%, #fff);
    color: var(--text-subdued);
    font-size: 0.75rem;
    font-weight: 600;
}

.portal-order-docs-chip .portal-icon-wrap,
.portal-order-docs-chip .portal-icon {
    width: 13px;
    height: 13px;
}

.portal-order-modal-items-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.portal-order-modal-items-head .portal-detail-title {
    margin: 0;
}

.portal-order-modal-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.portal-order-modal-item {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--border-subdued);
    border-radius: 14px;
    background: #fff;
}

.portal-order-modal-item .portal-order-product-thumb {
    width: 52px;
    height: 52px;
    border-radius: 12px;
}

.portal-order-modal-item-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.portal-order-modal-item-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.portal-order-modal-item-pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    text-align: right;
}

.portal-order-modal-item-unit {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 8px;
    font-size: 0.75rem;
    color: var(--text-subdued);
    font-variant-numeric: tabular-nums;
}

.portal-order-modal-price-list {
    text-decoration: line-through;
    color: var(--text-subdued);
    opacity: 0.85;
}

.portal-order-modal-price-sale {
    font-weight: 650;
    color: var(--text-primary);
}

.portal-order-modal-price-off {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--success) 12%, #fff);
    color: var(--success);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.portal-order-modal-item-total {
    font-size: 0.9375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.portal-order-modal-item-list-total {
    font-size: 0.75rem;
    color: var(--text-subdued);
    text-decoration: line-through;
    font-variant-numeric: tabular-nums;
}

.portal-order-modal-item-total-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-subdued);
}

.portal-order-modal-totals {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--divider);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.portal-order-modal-totals-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.875rem;
    color: var(--text-subdued);
    font-variant-numeric: tabular-nums;
}

.portal-order-modal-totals-row--discount {
    color: var(--success);
}

.portal-order-modal-totals-row--total {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-subdued);
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.portal-order-modal-totals-row--total strong {
    font-size: 1.0625rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.portal-order-modal-empty {
    padding: 20px;
    text-align: center;
    color: var(--text-subdued);
    border: 1px dashed var(--border-subdued);
    border-radius: 14px;
}

.stat-card-subtitle {
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--text-subdued);
}

.portal-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
}

.portal-table-empty-wrap {
    padding: 8px;
}

.portal-table-empty-wrap .portal-empty-state {
    margin: 0;
    border: none;
    box-shadow: none;
    background: transparent;
    padding: 40px 16px;
}

.portal-table-empty-wrap .portal-empty-state h3 {
    margin: 0 0 16px;
}

.portal-table-empty-wrap .portal-empty-state p {
    margin: 0;
}

/* Orders empty — atmospheric empty table state */
.portal-orders-empty-cell {
    position: relative !important;
    overflow: hidden;
    padding: 0 !important;
}

.portal-orders-empty {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 56px 28px 48px;
    text-align: center;
}

.portal-orders-empty__web {
    position: absolute;
    width: 148px;
    height: 148px;
    color: color-mix(in srgb, var(--text) 16%, transparent);
    pointer-events: none;
    z-index: 0;
}

.portal-orders-empty__web svg {
    display: block;
    width: 100%;
    height: 100%;
}

.portal-orders-empty__web--tl {
    top: 0;
    left: 0;
}

.portal-orders-empty__web--br {
    right: 0;
    bottom: 0;
}

.portal-orders-empty__inner {
    position: relative;
    z-index: 1;
    max-width: 360px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.portal-orders-empty__visual {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 20px;
    display: grid;
    place-items: center;
}

.portal-orders-empty__ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid color-mix(in srgb, var(--text) 28%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 6%, transparent);
    transform: scale(1.08);
    opacity: 0.55;
}

.portal-orders-empty__ring--delayed {
    transform: scale(1.28);
    opacity: 0.28;
}

.portal-orders-empty__icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(165deg, #2a2a2e 0%, #101012 72%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.16),
        0 10px 28px -12px rgba(16, 16, 18, 0.55);
}

[data-theme="dark"] .portal-orders-empty__icon {
    color: #101012;
    background: linear-gradient(165deg, #f7f7f8 0%, #e8e8ea 72%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        0 10px 28px -12px rgba(0, 0, 0, 0.55);
}

.portal-orders-empty__icon .portal-icon {
    width: 30px;
    height: 30px;
}

.portal-orders-empty__title {
    margin: 0 0 18px;
    font-size: 1.125rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.portal-orders-empty__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    margin: 0;
}

/* Mobile menu in header */
.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.mobile-menu-btn {
    display: none !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: var(--header-control-size, 44px) !important;
    height: var(--header-control-size, 44px) !important;
    min-width: var(--header-control-size, 44px);
    padding: 0;
    border: 1px solid rgba(10, 10, 10, 0.08);
    border-radius: var(--header-control-radius, 14px);
    background: #fff;
    color: var(--text-subdued);
    box-shadow: none !important;
    z-index: 1;
    cursor: pointer;
    box-sizing: border-box;
}

.mobile-menu-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: rgba(10, 10, 10, 0.14);
}

.mobile-menu-btn svg {
    width: var(--header-control-icon, 22px) !important;
    height: var(--header-control-icon, 22px) !important;
}

@media (max-width: 900px) {
    .mobile-menu-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .header-titles {
        display: none;
    }

    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        align-self: auto;
        width: 280px;
        height: 100vh;
        height: 100dvh;
        max-height: 100vh;
        max-height: 100dvh;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow: hidden;
        box-shadow: var(--shadow-2);
    }

    .sidebar.mobile-active {
        left: 0;
    }

    .sidebar-overlay.active {
        display: block !important;
        opacity: 1;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: visible;
    }

    .content-wrapper {
        padding: 16px;
    }

    .header-inner {
        padding: 12px 16px;
    }
}

@media (max-width: 1100px) {
    .portal-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-filters {
        grid-template-columns: minmax(0, 1.4fr) 1fr 1fr;
    }

    .portal-filter--search {
        grid-column: 1 / -1;
    }

    .portal-cart-layout {
        grid-template-columns: 1fr;
    }

    .portal-cart-line {
        grid-template-columns: 64px minmax(0, 1fr) 40px;
        grid-template-areas:
            "thumb info remove"
            "thumb meta meta"
            "total total total";
        gap: 12px 14px;
        padding: 16px 18px;
    }

    .portal-cart-line-thumb { grid-area: thumb; width: 64px; height: 64px; }
    .portal-cart-line-info { grid-area: info; }
    .portal-cart-line-qty { grid-area: meta; }
    .portal-cart-line-total {
        grid-area: total;
        min-width: 0;
        text-align: left;
        padding-top: 4px;
        border-top: 1px dashed var(--border-subdued);
    }
    .portal-cart-line .portal-remove-row { grid-area: remove; justify-self: end; }

    .portal-order-preview,
    .portal-cart-summary {
        position: static;
    }

    .portal-cart-panel-head {
        padding: 18px;
    }

    .portal-cart-syrup-note {
        padding: 14px 18px;
    }
}

@media (max-width: 768px) {
    .portal-stat-grid,
    .portal-stat-grid--compact,
    .portal-quick-actions {
        grid-template-columns: 1fr;
    }

    .portal-orders-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-orders-toolbar__action .btn {
        width: 100%;
        justify-content: center;
    }

    .portal-orders-toolbar__filters {
        flex-direction: column;
        align-items: stretch;
        min-width: 0;
    }

    .portal-orders-toolbar__filters .portal-filter--search,
    .portal-orders-toolbar__filters .portal-filter--status {
        max-width: none;
        width: 100%;
        flex: 1 1 auto;
    }

    .portal-filters {
        grid-template-columns: 1fr 1fr;
    }

    .portal-filter--search {
        grid-column: 1 / -1;
    }

    .card.portal-filters-shell {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding: 0 !important;
        margin-bottom: 10px;
        overflow: hidden;
    }

    .portal-filters-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1 1 auto;
        order: 1;
        min-width: 0;
        width: auto;
        margin: 0;
        padding: 12px 10px 12px 14px;
        border: 0;
        background: transparent;
        color: var(--text);
        font: inherit;
        font-size: 0.875rem;
        font-weight: 600;
        line-height: 1.2;
        text-align: left;
        cursor: pointer;
    }

    .portal-filters-toggle:focus-visible {
        outline: 2px solid var(--accent, #111);
        outline-offset: -2px;
    }

    .portal-filters-toggle__icon {
        display: inline-flex;
        flex: 0 0 auto;
        color: var(--text-subdued);
        line-height: 0;
    }

    .portal-filters-toggle__label {
        flex: 0 1 auto;
        min-width: 0;
    }

    .portal-filters-toggle__badge {
        flex: 0 0 auto;
        padding: 1px 6px;
        border-radius: 999px;
        background: rgba(16, 16, 18, 0.08);
        color: var(--text-subdued);
        font-size: 0.625rem;
        font-weight: 700;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        line-height: 1.35;
    }

    .portal-filters-toggle__chevron {
        flex: 0 0 auto;
        width: 7px;
        height: 7px;
        margin-left: auto;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        color: var(--text-subdued);
        transform: rotate(45deg);
        transition: transform 0.28s ease;
    }

    .portal-filters-shell:not(.is-collapsed) .portal-filters-toggle__chevron {
        transform: rotate(-135deg);
    }

    .portal-filters-shell .portal-filter-toolbar {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex: 0 1 auto;
        order: 2;
        gap: 8px;
        margin: 0;
        padding: 0 14px 0 0;
        min-height: 0;
    }

    .portal-filters-shell .portal-filter-count {
        font-size: 0.8125rem;
        white-space: nowrap;
    }

    .portal-filters-panel {
        display: block;
        flex: 1 1 100%;
        order: 3;
        overflow: hidden;
        height: 0;
        opacity: 0;
        border-top: 0 solid var(--border-subdued);
        pointer-events: none;
        transition:
            height 0.32s cubic-bezier(0.22, 1, 0.36, 1),
            opacity 0.24s ease,
            border-top-width 0.32s ease;
    }

    .portal-filters-shell:not(.is-collapsed) .portal-filters-panel {
        opacity: 1;
        border-top-width: 1px;
        pointer-events: auto;
    }

    .portal-filters-panel > .portal-filters {
        min-height: 0;
    }

    .portal-form-grid,
    .portal-order-detail-grid,
    .portal-order-summary,
    .portal-order-summary--modal {
        grid-template-columns: 1fr 1fr;
    }

    .portal-order-modal-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .portal-order-modal-hero-badges {
        justify-content: flex-start;
    }

    .portal-order-modal-item-main {
        flex-direction: column;
        align-items: flex-start;
    }

    .portal-order-modal-item-pricing {
        align-items: flex-start;
        text-align: left;
        width: 100%;
    }

    .portal-page-header .btn {
        width: 100%;
        justify-content: center;
    }

    .portal-responsive-table thead {
        display: none;
    }

    .portal-responsive-table tbody {
        display: grid;
        gap: 12px;
        padding: 12px;
    }

    .portal-responsive-table tr {
        display: grid;
        gap: 2px;
        margin: 0;
        border: 1px solid var(--border-subdued);
        border-radius: 14px;
        padding: 14px 14px 10px;
        background: var(--surface-card);
        box-shadow: var(--shadow-card);
    }

    .portal-responsive-table tr.portal-orders-empty-row,
    .portal-responsive-table tr.portal-orders-no-matches {
        display: block;
        border: none;
        box-shadow: none;
        background: transparent;
        padding: 0;
    }

    .portal-responsive-table tr.portal-orders-empty-row td,
    .portal-responsive-table tr.portal-orders-no-matches td {
        display: block;
        padding: 0;
        position: relative;
        overflow: hidden;
    }

    .portal-responsive-table tr.portal-orders-empty-row td::before,
    .portal-responsive-table tr.portal-orders-no-matches td::before {
        content: none;
    }

    .portal-orders-empty {
        margin: 0;
        padding: 48px 18px 40px;
    }

    .portal-orders-empty__web {
        width: 110px;
        height: 110px;
    }

    .portal-responsive-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 8px 0;
        border: none;
    }

    .portal-responsive-table td::before {
        content: attr(data-label);
        font-size: 0.6875rem;
        font-weight: 650;
        color: var(--text-subdued);
        text-transform: uppercase;
        letter-spacing: 0.06em;
        flex-shrink: 0;
    }

    .portal-responsive-table td.portal-col-actions,
    .portal-responsive-table td.portal-table-actions {
        width: auto;
        padding-top: 12px;
        margin-top: 4px;
        border-top: 1px solid var(--border-subdued);
        justify-content: flex-end;
    }

    .portal-responsive-table td.portal-col-actions::before,
    .portal-responsive-table td.portal-table-actions::before {
        display: none;
    }

    .portal-responsive-table .portal-order-qty {
        align-items: flex-end;
    }

    .portal-responsive-table .portal-order-products {
        max-width: none;
        min-width: 0;
        width: 100%;
        align-items: stretch;
    }

    .portal-responsive-table .portal-order-product-summary {
        justify-content: flex-end;
    }

    .portal-responsive-table .portal-status-stack--inline,
    .portal-responsive-table .portal-status-stack--labeled {
        justify-content: flex-end;
    }

    .portal-responsive-table .portal-status-item {
        align-items: flex-end;
    }

    .portal-responsive-table .portal-order-ref {
        align-items: flex-end;
        text-align: right;
    }

    .portal-responsive-table .portal-order-ref-meta {
        justify-content: flex-end;
    }

    .portal-spend-chart-select {
        width: 140px;
    }

    .portal-spend-chart-head {
        flex-wrap: wrap;
    }
}

/* ── Premium finishing touches ── */

/* Ambient top glow behind content */
.main-content {
    background:
        radial-gradient(900px 320px at 50% -80px, rgba(16, 16, 18, 0.035), transparent 70%),
        var(--surface);
}

/* Slim, unobtrusive scrollbars */
.main-content::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar,
.portal-table-wrap::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.main-content::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb,
.portal-table-wrap::-webkit-scrollbar-thumb {
    background: rgba(16, 16, 18, 0.16);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.main-content::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 16, 18, 0.28);
    background-clip: padding-box;
}

.main-content::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

/* Consistent, refined focus rings for keyboard users */
.btn:focus-visible,
.nav-item:focus-visible,
.header-icon-btn:focus-visible,
.user-menu-button:focus-visible,
.portal-product-cta:focus-visible,
.portal-settings-nav-item:focus-visible,
.sidebar-distributor:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px var(--surface),
        0 0 0 4.5px rgba(16, 16, 18, 0.45);
}

/* Selection color */
::selection {
    background: rgba(16, 16, 18, 0.9);
    color: #fff;
}

/* Header title hierarchy */
.header-title {
    font-size: 1.1875rem;
    font-weight: 650;
}

/* Sidebar surface aligned with new ink */
.sidebar {
    background:
        linear-gradient(180deg, #f5f5f6 0%, #f1f1f2 52%, #ededef 100%);
}

/* Modals inherit the premium float */
.modal {
    background-color: rgba(16, 16, 18, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    border-radius: 18px;
    border: 1px solid rgba(16, 16, 18, 0.08);
    box-shadow: var(--shadow-float);
    overflow: hidden;
}

/* Alert banners — softer, rounder */
.alert-banner {
    border-radius: var(--radius-control);
}
