/* ========================================================================
   Varbiri — PAGES CSS (Premium)
   Login • Dashboard • Orders • Quick Sale • Cart • Catalog • QR Menu
   ======================================================================== */

/* ========== LOGIN (modern aurora + mesh + glass card, perfectly centered) ========== */
.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    overflow: hidden;
    background: #060913; /* derin gece-mavisi — gradient altlığı */
}

.login-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

/* Katman 1 — Aurora (animated conic) */
.login-bg__aurora {
    position: absolute;
    inset: -20%;
    background: conic-gradient(
        from 0deg at 50% 50%,
        #1a2a6c 0deg,
        #2B66E8 60deg,
        #7C6AF2 140deg,
        #00C9DB 220deg,
        #2B66E8 300deg,
        #1a2a6c 360deg
    );
    filter: blur(120px);
    opacity: 0.55;
    will-change: transform;
    animation: auroraSpin 40s linear infinite;
}
@keyframes auroraSpin {
    from { transform: rotate(0deg) scale(1.1); }
    to   { transform: rotate(360deg) scale(1.1); }
}

/* Katman 2 — Mesh (renk ışıması) */
.login-bg__mesh {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(600px 400px at 15% 20%, rgba(43, 102, 232, 0.28), transparent 60%),
        radial-gradient(700px 500px at 85% 80%, rgba(124, 106, 242, 0.24), transparent 60%),
        radial-gradient(500px 400px at 50% 100%, rgba(0, 201, 219, 0.14), transparent 60%);
}

/* Katman 3 — İnce grid (center vignette ile softlandırılmış) */
.login-bg__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255,255,255,0.035) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 70% 55% at 50% 50%, black, transparent 75%);
            mask-image: radial-gradient(ellipse 70% 55% at 50% 50%, black, transparent 75%);
}

/* Katman 4 — SVG noise overlay (film grain) */
.login-bg__noise {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
    background-size: 200px 200px;
}

/* Katman 5 — Floating blob'lar (renk vurguları) */
.login-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.55;
    pointer-events: none;
    will-change: transform;
    animation: floatBlob 14s ease-in-out infinite;
}
.login-blob--1 { background: #2B66E8; width: 400px; height: 400px; top: -8%;  left: -5%;  }
.login-blob--2 { background: #7C6AF2; width: 500px; height: 500px; bottom: -10%; right: -8%; animation-delay: -7s; }
.login-blob--3 { background: #00C9DB; width: 300px; height: 300px; top: 40%;  left: 50%;   animation-delay: -4s; opacity: 0.35; }

@keyframes floatBlob {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%      { transform: translate(40px, -20px) scale(1.08); }
    66%      { transform: translate(-30px, 30px) scale(0.95); }
}

/* Animasyonu kapat — motion preference */
@media (prefers-reduced-motion: reduce) {
    .login-bg__aurora,
    .login-blob { animation: none !important; }
}

/* Shell — login-card'ı ve tüm araçlarını EKRANIN TAM ORTASINA yerleştirir */
.login-shell {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--space-5) var(--space-4);
}

.ui-icon-btn {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--surface-secondary);
    color: var(--text-muted);
    cursor: pointer;
}

.ui-icon-btn.is-favorite {
    border-color: var(--danger);
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.public-legal-shell {
    align-items: flex-start;
    overflow-y: auto;
}

.public-legal-card {
    width: min(760px, 100%);
    margin-block: var(--space-5);
}

.public-legal-card__head {
    display: grid;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.public-legal-card__head h1 {
    margin: 0;
    font-size: var(--font-size-2xl);
    line-height: var(--line-height-tight);
}

.public-legal-card__head p {
    margin: 0;
    color: var(--text-muted);
}

.public-legal-card__body {
    display: grid;
    gap: var(--space-3);
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
}

.public-legal-card__body :where(p, ul, ol) {
    margin: 0;
}

/* Card max-width — minimal centered login */
.login-shell > .login-card { max-width: 440px; }
.login-shell > .public-legal-card { max-width: 760px; }

/* Left hero side */
.login-hero {
    padding: clamp(2rem, 5vw, 4rem);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: var(--space-6);
    position: relative;
}

.login-hero__brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}
.login-hero__brand .ui-brand-logo { width: 48px; height: 48px; font-size: 16px; }

.login-hero__content { max-width: 520px; }
.login-hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 12px;
    background: var(--brand-muted);
    border: 1px solid var(--border-brand);
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    color: var(--brand-glow);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-5);
}
.login-hero__eyebrow i { font-size: 14px; }

.login-hero__title {
    font-size: clamp(2.2rem, 4.2vw, 3.4rem);
    font-weight: var(--fw-black);
    line-height: 1.08;
    letter-spacing: -0.03em;
    margin-bottom: var(--space-4);
    background: linear-gradient(180deg, #FFFFFF 0%, #8BB0FA 140%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.login-hero__desc {
    font-size: var(--fs-lg);
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: var(--space-7);
    max-width: 480px;
}

.login-hero__features {
    display: grid;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}
.login-hero__feature {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    color: var(--text-primary);
    font-size: var(--fs-sm);
}
.login-hero__feature-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    background: var(--grad-brand-soft);
    border: 1px solid var(--border-brand);
    color: var(--brand-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
}
.login-hero__feature-title { font-weight: var(--fw-semibold); color: var(--text-strong); margin-bottom: 2px; }
.login-hero__feature-sub { color: var(--text-muted); font-size: var(--fs-xs); }

.login-hero__footer {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    font-size: var(--fs-xs);
    color: var(--text-subtle);
    flex-wrap: wrap;
}
.login-hero__footer a { color: var(--text-muted); transition: color var(--dur-base); }
.login-hero__footer a:hover { color: var(--brand-bright); }

/* Right form side */
.login-form-side {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
}

.login-card {
    width: 100%;
    max-width: 520px;
    background: rgba(20, 26, 43, 0.65);
    -webkit-backdrop-filter: blur(28px);
    backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-2xl);
    padding: clamp(1.75rem, 3vw, 2.5rem);
    box-shadow: 0 30px 60px -12px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.06);
    position: relative;
    animation: cardAppear 800ms var(--ease-emphasized) both;
}
@keyframes cardAppear {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

html.theme-light .login-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-float);
}

.login-card__head {
    text-align: center;
    margin-bottom: var(--space-5);
}

.brand-logo {
    display: block;
    max-width: 100%;
    object-fit: contain;
}

.brand-logo--auth {
    width: 100%;
    height: 100%;
}

.brand-logo--horizontal {
    width: 100%;
    height: 100%;
}

.brand-logo--symbol {
    width: 100%;
    height: 100%;
}

.login-card__logo {
    width: 64px;
    height: 64px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    background: var(--grad-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: var(--fw-black);
    font-size: 22px;
    box-shadow: 0 12px 28px -6px rgba(43, 102, 232, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.login-card__logo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), transparent 50%);
}

.login-card__title {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    color: var(--text-strong);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}
.login-card__sub {
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

.login-form { display: flex; flex-direction: column; gap: var(--space-4); }
.login-form__row { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-xs); }
.login-form__forgot { color: var(--brand-bright); font-weight: var(--fw-semibold); transition: color var(--dur-base); flex-shrink: 0;}
.login-form__forgot:hover { color: var(--brand-glow); text-decoration: underline; }

.login-pass-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-muted);
}
.login-pass-toggle:hover { color: var(--text-primary); }

.login-form__divider {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    color: var(--text-subtle);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: var(--space-3) 0;
}
.login-form__divider::before,
.login-form__divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-soft);
}

.login-card__foot {
    margin-top: var(--space-5);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-soft);
    display: inline-flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-3);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}
.login-card__foot a,
.login-card__foot-link { color: var(--text-muted); font-weight: var(--fw-medium); transition: color var(--dur-base); }
.login-card__foot a:hover { color: var(--brand-bright); }
.login-card__foot-sep { opacity: 0.4; -webkit-user-select: none; user-select: none; }

.auth-shell {
    padding-top: clamp(2rem, 5vh, 4rem);
    padding-bottom: clamp(2rem, 5vh, 4rem);
}

.login-card--wide {
    max-width: 720px;
}

.login-card--account-list {
    max-width: 480px;
}

.auth-card-shell {
    max-height: calc(100vh - 3rem);
    max-height: calc(100dvh - 3rem);
    overflow: auto;
}

.login-card__head--stacked {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.login-card__head--stacked .login-card__logo {
    margin: 0;
}

.login-card__title--spaced {
    margin-top: var(--space-4);
}

.auth-form-shell {
    gap: var(--space-4);
}

.auth-form-shell--compact {
    gap: var(--space-5);
}

.auth-section-title {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-section-title--spaced {
    margin-top: var(--space-3);
}

.auth-consent-box {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.03);
}

.auth-consent-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    cursor: pointer;
    color: var(--text-primary);
    font-size: var(--fs-sm);
    line-height: 1.5;
}

.auth-consent-item input {
    margin-top: 4px;
}

.auth-footer-note {
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--text-subtle);
}

.auth-footer-note a {
    color: var(--brand-bright);
    font-weight: var(--fw-semibold);
}

.auth-inline-alert {
    margin-bottom: var(--space-4);
}

.auth-status-list {
    display: grid;
    gap: var(--space-3);
}

.auth-status-row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    background: rgba(255, 255, 255, 0.03);
}

.auth-status-row strong {
    color: var(--text-strong);
}

.auth-status-row span {
    color: var(--text-muted);
    text-align: right;
}

.auth-pending-note {
    padding: var(--space-4);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-brand);
    background: var(--brand-muted);
    color: var(--text-primary);
}

.account-option {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color var(--dur-base), background var(--dur-base), transform var(--dur-base);
}

.account-option:hover {
    border-color: var(--brand-primary);
    background: var(--brand-muted);
    transform: translateY(-1px);
}

.account-option input {
    margin-top: 3px;
}

.account-option input:checked ~ .account-option__body {
    color: var(--brand-bright);
}

.account-option__body {
    flex: 1;
}

.account-option__name {
    font-weight: var(--fw-semibold);
    color: var(--text-strong);
}

.account-option__role {
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

.auth-success-modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    background: rgba(7, 10, 19, 0.62);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.auth-success-modal__dialog {
    width: min(100%, 560px);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--space-4);
    align-items: start;
    padding: var(--space-5);
    border-radius: var(--radius-2xl);
    border: 1px solid rgba(77, 197, 125, 0.35);
    background: rgba(15, 23, 42, 0.92);
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.35);
}

.auth-success-modal__icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(77, 197, 125, 0.16);
    color: #4dc57d;
    font-size: 22px;
}

.auth-success-modal__title {
    display: block;
    margin-bottom: 6px;
    color: var(--text-strong);
    font-size: var(--fs-lg);
}

.auth-success-modal__text {
    color: var(--text-muted);
    line-height: 1.6;
}

.auth-success-modal__close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    transition: background var(--dur-base), color var(--dur-base);
}

.auth-success-modal__close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

html.theme-light .auth-consent-box,
html.theme-light .auth-status-row {
    background: rgba(15, 23, 42, 0.03);
}

html.theme-light .auth-success-modal__dialog {
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-float);
}

@media (max-width: 640px) {
    .auth-card-shell {
        max-height: none;
    }

    .auth-status-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-status-row span {
        text-align: left;
    }

    .auth-success-modal__dialog {
        grid-template-columns: 1fr;
    }

    .auth-success-modal__close {
        justify-self: end;
    }
}

@media (max-width: 900px) {
    .login-hero { display: none; }
    .login-form-side { padding: var(--space-4); width: 100%; }
}

/* ========== CHARTS (inline SVG) ========== */
.chart-card { padding: 0; }
.chart-card .ui-card__header { padding: var(--space-5) var(--space-6); }
.chart-card .ui-card__body { padding: var(--space-5) var(--space-6) var(--space-6); }

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}
.chart-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-xs);
    color: var(--text-muted);
}
.chart-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}
.chart-legend__dot--brand { background: var(--brand-bright); }
.chart-legend__dot--violet-muted {
    background: var(--accent-violet);
    opacity: 0.6;
}

.chart-svg { width: 100%; height: 260px; overflow: visible; }
.chart-svg .grid-line { stroke: var(--border-subtle); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-svg .axis-text { fill: var(--text-subtle); font-size: 11px; font-family: var(--font-sans); }

.chart-area-path {
    fill: url(#chart-gradient-brand);
    opacity: 0.45;
    transition: opacity var(--dur-smooth);
}
.chart-line {
    fill: none;
    stroke: var(--brand-bright);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 4px 8px rgba(43, 102, 232, 0.4));
}
.chart-point {
    fill: var(--brand-bright);
    stroke: var(--surface-primary);
    stroke-width: 2;
    r: 4;
    transition: r var(--dur-base);
}
.chart-point:hover { r: 6; }

/* Donut chart */
.chart-donut-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    flex-wrap: wrap;
}
.chart-donut {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
    position: relative;
}
.chart-donut__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.chart-donut__center-value {
    font-size: 1.8rem;
    font-weight: var(--fw-black);
    color: var(--text-strong);
    line-height: 1;
    letter-spacing: -0.02em;
}
.chart-donut__center-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 4px;
}
.chart-donut__track {
    fill: none;
    stroke: var(--surface-raised);
    stroke-width: 14;
}
.chart-donut__segment {
    fill: none;
    stroke-width: 14;
    stroke-linecap: round;
    transition: stroke-width var(--dur-base);
}
.chart-donut__segment:hover { stroke-width: 18; }

.chart-donut-list {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.chart-donut-list__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--fs-sm);
}
.chart-donut-list__dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; background: var(--dot-color); }
.chart-donut-list__dot--brand { --dot-color: #548BF5; }
.chart-donut-list__dot--violet { --dot-color: #7C6AF2; }
.chart-donut-list__dot--cyan { --dot-color: #00C9DB; }
.chart-donut-list__dot--amber { --dot-color: #F5B142; }
.chart-donut-list__label { color: var(--text-primary); flex: 1; min-width: 0; }
.chart-donut-list__value { font-weight: var(--fw-semibold); color: var(--text-strong); font-variant-numeric: tabular-nums; }

/* Bar chart mini */
.chart-bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: var(--space-3); }
.chart-bars--dashboard { height: 180px; }
.chart-bars__col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.chart-bars__bar {
    width: 100%;
    height: var(--bar-h, 8%);
    background: var(--grad-brand);
    border-radius: 6px 6px 2px 2px;
    transition: all var(--dur-smooth) var(--ease-bounce);
    position: relative;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
    min-height: 4px;
}
.chart-bars__bar:hover { filter: brightness(1.15); transform: scaleY(1.04); transform-origin: bottom; }
.chart-bars__bar--alt { background: linear-gradient(180deg, var(--accent-violet), #5B4BC7); }
.chart-bars__bar--h-85 { --bar-h: 85%; }
.chart-bars__bar--h-72 { --bar-h: 72%; }
.chart-bars__bar--h-65 { --bar-h: 65%; }
.chart-bars__bar--h-55 { --bar-h: 55%; }
.chart-bars__bar--h-48 { --bar-h: 48%; }
.chart-bars__bar--h-38 { --bar-h: 38%; }
.chart-bars__bar--h-32 { --bar-h: 32%; }
.chart-bars__bar--h-28 { --bar-h: 28%; }
.chart-bars__label { font-size: 10px; color: var(--text-muted); }

/* Donut card (admin plan distribution) */
.ui-donut-card { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; }
.ui-donut-card__chart {
    width: 140px; height: 140px; border-radius: 50%; flex-shrink: 0;
    background: var(--donut-bg, #e5e7eb);
    position: relative;
}
.ui-donut-card__chart::after {
    content: ''; position: absolute;
    inset: 25%; border-radius: 50%;
    background: var(--surface-primary);
}
.ui-legend-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.ui-legend-list li { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); }
.ui-legend-list__swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; background: var(--dot-color); }
.ui-legend-list strong { margin-left: auto; font-variant-numeric: tabular-nums; }

/* Dashboard quick actions grid */
.ui-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--space-3);
}

.ui-quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.ui-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-5) var(--space-3);
    background: var(--surface-secondary);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    transition: all var(--dur-smooth) var(--ease-bounce);
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.ui-quick-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--grad-brand);
    opacity: 0;
    transition: opacity var(--dur-base);
}
.ui-quick-action:hover {
    transform: translateY(-4px);
    border-color: var(--border-brand);
    background: var(--surface-elevated);
    box-shadow: 0 14px 28px -8px rgba(0,0,0,0.5), 0 0 24px rgba(43, 102, 232, 0.18);
}
.ui-quick-action:hover::before { opacity: 1; }
.ui-quick-action__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--grad-brand-soft);
    border: 1px solid var(--border-brand);
    color: var(--brand-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all var(--dur-base);
}
.ui-quick-action:hover .ui-quick-action__icon {
    background: var(--grad-brand);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 20px -4px rgba(43, 102, 232, 0.55);
    transform: scale(1.06);
}
.ui-quick-action__label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }

/* Dashboard charts grid */
.dashboard-charts-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: var(--space-5);
    margin-bottom: var(--space-7);
}
@media (min-width: 1025px) {
    .dashboard-card--table,
    .dashboard-card--activity {
        min-height: 504px;
    }

    .dashboard-card--trend {
        min-height: 422px;
    }
}
@media (max-width: 1024px) {
    .dashboard-charts-grid { grid-template-columns: 1fr; }
    .dashboard-card--trend {
        min-height: 422px;
    }
    .dashboard-card--distribution {
        min-height: 307px;
    }
    .dashboard-card--table {
        min-height: 430px;
    }
    .dashboard-card--activity {
        min-height: 504px;
    }
}

.ui-segmented {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    background: var(--surface-secondary);
}

.ui-segmented a {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
}

.ui-segmented a.is-active {
    background: var(--brand-bright);
    color: #fff;
}

.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;
}

.dashboard-sales-chart {
    width: 100%;
    min-height: 220px;
}

.dashboard-sales-chart text {
    fill: var(--text-muted);
    font-size: 11px;
}

.dashboard-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--space-4);
}

.dashboard-range-selector {
    position: relative;
    display: inline-block;
}

.dashboard-range-selector > summary {
    display: grid;
    grid-template-columns: minmax(44px, auto) minmax(126px, auto);
    align-items: center;
    gap: var(--space-2);
    list-style: none;
    cursor: pointer;
}

.dashboard-range-selector > summary::-webkit-details-marker {
    display: none;
}

.dashboard-range-popover__panel {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    z-index: 20;
    display: grid;
    gap: var(--space-2);
    min-width: 180px;
    padding: var(--space-3);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: var(--surface-elevated);
    box-shadow: var(--shadow-lg);
}

.dashboard-range-popover:not([open]) .dashboard-range-popover__panel {
    display: none;
}

.dashboard-range-selector__label {
    color: var(--text-strong);
    font-size: var(--fs-sm);
    line-height: 1.1;
}

.dashboard-range-selector__value {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    min-height: 46px;
    padding: 0 var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    background: var(--surface-secondary);
    color: var(--text-strong);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
}

.dashboard-range-selector__value::after {
    content: '';
    width: 7px;
    height: 7px;
    margin-left: var(--space-4);
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    opacity: 0.72;
}

.dashboard-range-selector__item {
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    text-decoration: none;
}

.dashboard-range-selector__item.is-active {
    background: var(--brand-bright);
    color: #fff;
}

.dashboard-subscription-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4);
    margin-bottom: var(--space-5);
    border: 1px solid var(--warning-ring);
    border-radius: var(--radius-lg);
    background: var(--warning-bg);
}

.dashboard-subscription-alert--danger {
    border-color: var(--danger-ring);
    background: var(--danger-bg);
}

.dashboard-subscription-alert__title {
    display: block;
    font-weight: var(--fw-semibold);
    color: var(--text-strong);
}

.dashboard-subscription-alert__body {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: var(--fs-sm);
}

/* Activity list */
.activity-list { display: flex; flex-direction: column; position: relative; }
.activity-list::before {
    content: '';
    position: absolute;
    top: 16px;
    bottom: 16px;
    left: 15px;
    width: 2px;
    background: linear-gradient(180deg, var(--border-soft), var(--border-subtle));
    border-radius: var(--radius-pill);
    pointer-events: none;
    z-index: 0;
}
.activity-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border-subtle);
    align-items: flex-start;
    position: relative;
    z-index: 1;
}
.activity-item:last-child { border-bottom: 0; }
.activity-item__dot {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--grad-brand-soft);
    border: 1px solid var(--border-brand);
    color: var(--brand-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px var(--surface-primary);
}
.activity-item__dot--success { background: var(--success-bg); border-color: var(--success-ring); color: var(--success); }
.activity-item__dot--warning { background: var(--warning-bg); border-color: var(--warning-ring); color: var(--warning); }
.activity-item__body { flex: 1; min-width: 0; }
.activity-item__text { font-size: var(--fs-sm); color: var(--text-primary); }
.activity-item__text strong { color: var(--text-strong); font-weight: var(--fw-semibold); }
.activity-item__time { font-size: var(--fs-xs); color: var(--text-subtle); margin-top: 2px; }

/* ========== ORDERS LIST ========== */
.orders-kpi-grid {
    margin-bottom: var(--space-6);
}

.orders-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
}
.orders-toolbar__left,
.orders-toolbar__right {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}
.orders-toolbar__left {
    min-width: 0;
    flex: 0 1 739px;
    max-width: 100%;
}

.orders-filters {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
}

.orders-bulk-form {
    margin-bottom: var(--space-3);
}

.orders-bulk-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--surface-secondary);
}

.order-detail-toolbar {
    margin-bottom: var(--space-5);
}

.order-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: var(--space-5);
    align-items: start;
}

.order-detail-main {
    min-width: 0;
}

.order-detail-main > * + * {
    margin-top: var(--space-4);
}

.order-detail-side {
    min-width: 0;
}

.order-detail-sticky {
    position: sticky;
    top: var(--space-4);
    display: grid;
    gap: var(--space-4);
}

.order-detail-panel {
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--surface-primary);
    padding: var(--space-4);
}

.order-detail-panel h2 {
    margin: 0 0 var(--space-3);
    font-size: var(--fs-md);
    color: var(--text-strong);
}

.order-detail-list {
    display: grid;
    gap: var(--space-2);
}

.order-detail-list + .ui-btn,
.order-detail-list + .order-detail-actions-row {
    margin-top: var(--space-3);
}

.order-detail-list__row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding-block: var(--space-2);
    border-bottom: 1px solid var(--border-soft);
    font-size: var(--fs-sm);
}

.order-detail-list__row:last-child {
    border-bottom: 0;
}

.order-detail-list__row span {
    color: var(--text-muted);
}

.order-detail-list__row strong {
    color: var(--text-strong);
    font-weight: var(--fw-semibold);
    text-align: right;
    overflow-wrap: anywhere;
}

.order-detail-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.order-detail-totals {
    position: static;
}

.ui-dropdown__item.is-disabled,
.ui-btn.is-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.ui-muted {
    color: var(--text-muted);
    font-size: var(--fs-sm);
}

@media (max-width: 991px) {
    .order-detail-layout {
        grid-template-columns: 1fr;
    }

    .order-detail-sticky {
        position: static;
    }
}

/* Bulk actions bar */
.bulk-actions-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    background: var(--surface-secondary);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    transition: all var(--dur-base);
}
.bulk-actions-bar:has(input:checked) {
    border-color: var(--border-brand);
    background: var(--brand-muted);
}
.bulk-actions-bar__actions {
    display: flex;
    gap: var(--space-3);
}
.cart-bulk-bar__label {
    color: var(--text-strong);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
}

/* ========== QUICK SALE (POS) ========== */
.pos-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-5);
    min-height: calc(100vh - var(--topbar-height) - var(--space-7) * 2);
}

.pos-products { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }

.pos-category-chips {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    scroll-snap-type: x mandatory;
}
.pos-category-chips .ui-chip { scroll-snap-align: start; flex-shrink: 0; }

.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-3);
}

.pos-product-card {
    background: var(--grad-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--dur-smooth) var(--ease-bounce);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xs);
}
.pos-product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(43, 102, 232, 0.12), transparent 70%);
    opacity: 0;
    transition: opacity var(--dur-base);
    pointer-events: none;
    z-index: 1;
}
.pos-product-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-brand);
    box-shadow: 0 14px 28px -8px rgba(0,0,0,0.55), 0 0 24px rgba(43, 102, 232, 0.2);
}
.pos-product-card:hover::before { opacity: 1; }
.pos-product-card:active { transform: translateY(-2px) scale(0.98); }

.pos-product-card__add {
    position: absolute;
    bottom: var(--space-3);
    right: var(--space-3);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--brand-bright);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(43, 102, 232, 0.4);
    opacity: 0;
    transform: scale(0.8) translateY(10px);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}
.pos-product-card:hover .pos-product-card__add {
    opacity: 1;
    transform: scale(1) translateY(0);
}
.pos-product-card__add:hover {
    background: var(--brand);
    transform: scale(1.1) !important;
}

.pos-product-card__image {
    aspect-ratio: 4/3;
    background: var(--surface-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-subtle);
    font-size: 32px;
    position: relative;
    overflow: hidden;
}
.pos-product-card__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.3));
}

.pos-product-card__stock {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.6);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-xs);
    font-size: 10px;
    font-weight: var(--fw-semibold);
    color: #fff;
    z-index: 2;
}
.pos-product-card__stock.is-low { background: rgba(225, 76, 76, 0.85); }

.pos-product-card__body {
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    z-index: 2;
}
.pos-product-card__name {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-strong);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 2.6em;
}
.pos-product-card__price {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    color: var(--brand-glow);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

/* POS Cart — Slide-out Drawer */
.pos-cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7, 10, 19, 0.65);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    z-index: var(--z-modal-bd);
    opacity: 0;
    visibility: hidden;
    transition: all var(--dur-smooth) var(--ease-standard);
}
.pos-cart-overlay.is-open { opacity: 1; visibility: visible; }

.pos-cart {
    position: fixed;
    top: 0;
    right: 0;
    width: 440px;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: var(--surface-primary);
    background-image: var(--grad-ambient);
    border-left: 1px solid var(--border-soft);
    display: flex;
    flex-direction: column;
    z-index: var(--z-modal);
    box-shadow: -20px 0 60px rgba(0,0,0,0.5);
    transform: translateX(100%);
    transition: transform var(--dur-smooth) var(--ease-emphasized);
}
.pos-cart.is-open { transform: translateX(0); }

/* Floating cart FAB */
.pos-cart-fab {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--grad-brand);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 12px 32px -6px rgba(43, 102, 232, 0.65), inset 0 1px 0 rgba(255,255,255,0.25);
    cursor: pointer;
    z-index: var(--z-sticky);
    transition: all var(--dur-base) var(--ease-bounce);
    animation: fabPulse 3s ease-in-out infinite;
}
.pos-cart-fab:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 18px 44px -8px rgba(43, 102, 232, 0.8);
}
.pos-cart-fab:active { transform: scale(0.95); }
.pos-cart-fab__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: var(--radius-pill);
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: var(--fw-bold);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(225,76,76,0.5);
    border: 2px solid var(--surface-base);
}
@keyframes fabPulse {
    0%, 100% { box-shadow: 0 12px 32px -6px rgba(43, 102, 232, 0.65); }
    50% { box-shadow: 0 12px 32px -6px rgba(43, 102, 232, 0.65), 0 0 0 12px rgba(43, 102, 232, 0.08); }
}
.pos-cart__head {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-secondary);
}
.pos-cart__title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    color: var(--text-strong);
}
.pos-cart__title i { color: var(--brand-bright); }
.pos-cart__count {
    padding: 2px 10px;
    background: var(--brand-muted);
    color: var(--brand-glow);
    border: 1px solid var(--border-brand);
    border-radius: var(--radius-pill);
    font-size: var(--fs-xs);
    font-weight: var(--fw-bold);
}

.pos-cart__customer {
    padding: var(--space-3) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
}
.pos-customer-chip {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 12px;
    background: var(--surface-elevated);
    border: 1px dashed var(--border-soft);
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    color: var(--text-primary);
    cursor: pointer;
    width: 100%;
    transition: all var(--dur-base);
}
.pos-customer-chip:hover { border-color: var(--border-brand); background: var(--surface-secondary); }
.pos-customer-chip__name { flex: 1; color: var(--text-strong); font-weight: var(--fw-medium); }

.pos-cart__items {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.pos-cart-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--surface-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--dur-base);
    animation: cartItemIn 300ms var(--ease-emphasized) both;
}
@keyframes cartItemIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}
.pos-cart-item:hover { border-color: var(--border-soft); background: var(--surface-elevated); }

.pos-cart-item__thumb {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-subtle);
    font-size: 18px;
    flex-shrink: 0;
}
.pos-cart-item__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pos-cart-item__name {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-strong);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pos-cart-item__meta { font-size: var(--fs-xs); color: var(--text-muted); }
.pos-cart-item__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}
.pos-cart-item__price {
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    color: var(--brand-glow);
    font-variant-numeric: tabular-nums;
}

/* Qty stepper */
.pos-qty {
    display: inline-flex;
    align-items: center;
    background: var(--surface-primary);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.pos-qty__btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: var(--fw-bold);
    transition: background var(--dur-base);
    padding: 0;
}
.pos-qty__btn:hover { background: var(--surface-elevated); color: var(--brand-bright); }
.pos-qty__value {
    min-width: 28px;
    text-align: center;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-strong);
    font-variant-numeric: tabular-nums;
}

.pos-qty__input {
    width: 56px;
    min-height: 28px;
    border: 0;
    background: transparent;
    padding: 0 var(--space-1);
}

.pos-qty__input:focus {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
}

.pos-cart-item__remove {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-subtle);
    font-size: 14px;
    border-radius: var(--radius-xs);
    transition: all var(--dur-base);
    flex-shrink: 0;
}
.pos-cart-item__remove:hover { color: var(--danger); background: var(--danger-bg); }

/* Cart totals */
.pos-cart__totals {
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-soft);
    background: var(--surface-secondary);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.pos-total-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-sm);
    color: var(--text-muted);
}
.pos-total-row .amt { color: var(--text-primary); font-variant-numeric: tabular-nums; font-weight: var(--fw-semibold); }
.pos-total-row.is-discount .amt { color: var(--success); }
.pos-total-row.is-final {
    padding-top: var(--space-3);
    border-top: 1px solid var(--border-soft);
    margin-top: var(--space-2);
    font-size: var(--fs-lg);
    color: var(--text-strong);
    font-weight: var(--fw-bold);
}
.pos-total-row.is-final .amt {
    font-size: var(--fs-xl);
    color: var(--text-strong);
    background: var(--grad-number);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.pos-cart__actions { padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); }

/* POS empty state */
.pos-cart-empty {
    padding: var(--space-8) var(--space-5);
    text-align: center;
    color: var(--text-muted);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
}
.pos-cart-empty__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--surface-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--text-subtle);
}

/* Catalog tree indent (data-driven depth via custom property) */
[data-dynamic="catalog-depth-indent"] { padding-left: var(--depth-indent, 0); }
.tree-indent { color: var(--text-subtle); margin-right: var(--space-2); user-select: none; }

/* ========== CATALOG (customer + QR) ========== */
.catalog-topbar {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: rgba(14, 19, 32, 0.82);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    padding: var(--space-4) var(--space-6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    min-height: var(--topbar-height);
}
html.theme-light .catalog-topbar { background: rgba(255,255,255,0.88); border-bottom: 1px solid var(--border-soft); }

.catalog-brand { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.catalog-page .catalog-brand .ui-brand-copy { display: block; }
.catalog-page .catalog-brand .ui-brand-copy__name { display: block; }
.catalog-topbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
}

.catalog-categories {
    position: sticky;
    top: var(--topbar-height);
    z-index: calc(var(--z-sticky) - 1);
    background: rgba(14, 19, 32, 0.88);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0;
    overflow: visible;
}
html.theme-light .catalog-categories { background: rgba(255,255,255,0.92); border-bottom: 1px solid var(--border-soft); }

.catalog-categories-inner {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding: var(--space-3) var(--space-6);
    scroll-snap-type: x mandatory;
}
.catalog-categories-inner::-webkit-scrollbar { display: none; }
.catalog-categories-inner .ui-chip { flex-shrink: 0; scroll-snap-align: start; }

.catalog-main {
    width: 100%;
    margin: 0 auto;
    padding: var(--space-6) var(--space-6);
}

.catalog-search-row {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
}
.catalog-search-row .ui-search { flex: 1; min-width: 240px; }
.catalog-search-row .ui-select {
    width: auto;
    min-width: 180px;
}
.catalog-sort-select {
    width: auto;
    min-width: 180px;
}
.catalog-cart-link {
    position: relative;
}
.catalog-cart-link .ui-badge--count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    font-size: 11px;
    font-weight: var(--fw-bold);
    background: var(--brand);
    color: #fff;
    box-shadow: 0 0 0 3px var(--surface-base);
}
.catalog-cart-link--reference .ui-badge--count {
    top: 4px;
    right: 4px;
    height: auto;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: var(--fw-semibold);
    line-height: 1.4;
    box-shadow: none;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-7);
}

.catalog-card {
    background: var(--grad-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    overflow: hidden;
    transition: all var(--dur-smooth) var(--ease-bounce);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xs);
    position: relative;
}
.catalog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 30%;
    right: 30%;
    height: 1px;
    background: var(--grad-accent-line);
    opacity: 0;
    transition: opacity var(--dur-base);
    z-index: 2;
}
.catalog-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-brand);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5), 0 0 30px rgba(43, 102, 232, 0.18);
}
.catalog-card:hover::before { opacity: 1; }
.catalog-card:hover .catalog-card__image > i { transform: scale(1.1); }
.catalog-card:hover .catalog-card__image::after { background: linear-gradient(180deg, transparent 40%, rgba(43,102,232,0.15) 100%); }

.catalog-card__image {
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, var(--surface-raised), var(--surface-elevated));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-subtle);
    font-size: 36px;
    position: relative;
    overflow: hidden;
}
.catalog-card__image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.25) 100%);
    pointer-events: none;
    transition: background var(--dur-smooth);
}
.catalog-card__image > i {
    transition: transform var(--dur-smooth) var(--ease-bounce);
}
.catalog-card__badge {
    position: absolute;
    top: var(--space-3);
    left: var(--space-3);
    padding: 3px 10px;
    background: var(--grad-brand);
    color: #fff;
    border-radius: var(--radius-pill);
    font-size: 10px;
    font-weight: var(--fw-bold);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: 0 4px 12px -2px rgba(43,102,232,0.5);
    z-index: 2;
}
.catalog-card__badge--sold { background: var(--surface-raised); color: var(--text-muted); box-shadow: none; }
.catalog-card__badge--discount {
    top: auto;
    bottom: var(--space-3);
    background: var(--success-bg);
    color: var(--success);
    box-shadow: none;
}

.catalog-card__fav {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--dur-base);
    z-index: 2;
    font-size: 16px;
    line-height: normal;
    text-decoration: none;
}
.catalog-card__fav:hover { background: var(--danger); transform: scale(1.1); }
.catalog-card__fav.is-active { background: var(--danger); color: #fff; }

.catalog-card__body { padding: var(--space-4); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.catalog-card__category {
    font-size: 10px;
    color: var(--text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: var(--fw-semibold);
}
.catalog-card__name {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-strong);
    line-height: 1.3;
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.catalog-card__price-row {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    margin-top: var(--space-2);
}
.catalog-card__price {
    font-size: var(--fs-lg);
    font-weight: var(--fw-black);
    color: var(--brand-glow);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.catalog-card__price-old { font-size: var(--fs-xs); color: var(--text-subtle); text-decoration: line-through; }

.catalog-card__foot {
    padding: 0 var(--space-4) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.portal-product-card__actions .portal-add-to-cart,
.portal-product-card__actions .ui-btn--full {
    width: 100%;
}
.portal-product-card__actions .ui-btn {
    justify-content: center;
}
.catalog-card__stock { font-size: var(--fs-xs); color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.catalog-card__stock.is-low { color: var(--danger); font-weight: var(--fw-semibold); }
.catalog-card__stock.is-low::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 6px var(--danger); }

/* ========== CART (customer) ========== */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: var(--space-5);
    align-items: flex-start;
}
@media (max-width: 1024px) {
    .cart-layout { grid-template-columns: 1fr; }
}

.cart-list { display: flex; flex-direction: column; gap: var(--space-3); }
.cart-page-head {
    margin-bottom: var(--space-5);
}

.cart-item {
    display: grid;
    grid-template-columns: auto 88px 1fr auto;
    gap: var(--space-4);
    padding: var(--space-4);
    background: var(--grad-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    align-items: center;
    transition: all var(--dur-base);
    box-shadow: var(--shadow-xs);
}
.cart-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: scale(1.01); }
.cart-item__image {
    width: 88px;
    height: 88px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--surface-raised), var(--surface-elevated));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-subtle);
    font-size: 28px;
}
.cart-item__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cart-item__name {
    font-size: var(--fs-md);
    font-weight: var(--fw-semibold);
    color: var(--text-strong);
    line-height: 1.25;
}
.cart-item__sub { font-size: var(--fs-xs); color: var(--text-muted); display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.cart-item__qty-row { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-2); }
.cart-item__qty-form {
    display: inline-flex;
}
.cart-item__favorite {
    display: inline-flex;
    margin-top: 0;
}

.cart-item__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--space-3);
    min-width: 100px;
}
.cart-item__price {
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    color: var(--brand-glow);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}

.cart-summary-card {
    position: sticky;
    top: calc(var(--topbar-height) + var(--space-5));
}

.cart-summary-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-5);
    border-bottom: 1px solid var(--border-soft);
}
.cart-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-sm);
    color: var(--text-muted);
}
.cart-summary-row .amt { color: var(--text-primary); font-variant-numeric: tabular-nums; font-weight: var(--fw-semibold); }
.cart-summary-row.is-discount .amt { color: var(--success); }

.cart-progress {
    padding: var(--space-4) var(--space-5);
    background: var(--surface-secondary);
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--fs-xs);
}
.cart-page-main--reference {
    padding-bottom: 100px;
}
.cart-note-card {
    margin-top: var(--space-4);
}
.cart-note-icon {
    margin-right: 6px;
}
.cart-summary-status {
    padding: var(--space-3) var(--space-5) 0;
}
.cart-summary-row__free {
    color: var(--success);
}
.cart-progress__bar {
    flex: 1;
    height: 6px;
    background: var(--surface-raised);
    border-radius: var(--radius-pill);
    overflow: hidden;
}
.cart-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success), #10956D);
    box-shadow: 0 0 12px var(--success);
    border-radius: var(--radius-pill);
    transition: width var(--dur-smooth);
}
.cart-progress__fill--full { width: 100%; }
.cart-progress__icon {
    color: var(--success);
    font-size: 18px;
}
.cart-progress__body {
    flex: 1;
}
.cart-progress__label {
    margin-bottom: 4px;
    color: var(--text-strong);
    font-weight: var(--fw-semibold);
}

.cart-total-row {
    padding: var(--space-4) var(--space-5);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid var(--border-soft);
}
.cart-total-row__label { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-strong); }
.cart-total-row__value {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-black);
    background: var(--grad-number);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.cart-summary-card__actions { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-2); }

.cart-mobile-summary {
    display: none;
}

.ui-list-table tr.cart-item {
    display: table-row;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
}
.ui-list-table tr.cart-item:hover {
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

.cart-info-row {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid var(--border-subtle);
    font-size: var(--fs-xs);
    color: var(--text-muted);
    align-items: flex-start;
}
.cart-info-row__icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }
.cart-info-row--info .cart-info-row__icon { color: var(--info); }
.cart-info-row--success .cart-info-row__icon { color: var(--success); }

/* ========== PORTAL BOTTOM NAV ========== */
.portal-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
    background: rgba(14, 19, 32, 0.92);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-subtle);
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    z-index: var(--z-sticky);
}
html.theme-light .portal-bottom { background: rgba(255,255,255,0.92); }
.portal-bottom__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: var(--fw-semibold);
    position: relative;
    transition: color var(--dur-base);
}
.portal-bottom__item i { font-size: 22px; }
.portal-bottom__item.is-active { color: var(--brand-bright); }
.portal-bottom__item.is-active::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    background: var(--grad-brand);
    border-radius: var(--radius-pill);
    box-shadow: 0 0 8px var(--brand-bright);
}
.portal-bottom__item .ui-badge--count {
    position: absolute;
    top: 4px;
    right: calc(50% - 20px);
}
@media (max-width: 900px) {
    .portal-bottom { display: flex; }
}

.qr-hero {
    padding: clamp(1rem, 3vw, 2rem) clamp(1rem, 4vw, 2rem);
    text-align: left;
    position: relative;
    background: var(--grad-hero);
    border-bottom: 1px solid var(--border-subtle);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5);
    flex-wrap: wrap;
}
.qr-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(500px 300px at 0% 50%, rgba(43,102,232,0.12), transparent 60%),
        radial-gradient(400px 300px at 100% 50%, rgba(124,106,242,0.10), transparent 60%);
    pointer-events: none;
}
.qr-hero__content {
    flex: 1;
    min-width: 300px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.qr-hero__logo {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    background: var(--grad-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: var(--fw-black);
    font-size: 22px;
    box-shadow: 0 14px 32px -6px rgba(43, 102, 232, 0.55), inset 0 1px 0 rgba(255,255,255,0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
    flex-shrink: 0;
}
.qr-hero__logo::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.3), transparent 55%);
}
.qr-hero__name {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: var(--fw-black);
    background: var(--grad-text-strong);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
    margin-bottom: var(--space-1);
    position: relative;
    z-index: 1;
}
.qr-hero__desc {
    color: var(--text-muted);
    font-size: var(--fs-sm);
    max-width: 100%;
    position: relative;
    z-index: 1;
}
.qr-hero__meta {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
    background: var(--surface-secondary);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
}
.qr-hero__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: var(--fs-sm);
}
.qr-hero__meta-item i { color: var(--brand-bright); }

.qr-cta-banner {
    margin-top: var(--space-7);
    padding: var(--space-5);
    background: var(--grad-surface);
    border: 1px solid var(--border-brand);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    justify-content: space-between;
    flex-wrap: wrap;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}
.qr-cta-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 0% 0%, rgba(43, 102, 232, 0.15), transparent 55%);
    pointer-events: none;
}
.qr-cta-banner__body { display: flex; align-items: center; gap: var(--space-3); min-width: 0; position: relative; z-index: 1; }
.qr-cta-banner__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--grad-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 8px 20px -4px rgba(43, 102, 232, 0.5);
}
.qr-cta-banner__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-strong); }
.qr-cta-banner__desc { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.qr-cta-banner__actions { display: flex; gap: var(--space-2); position: relative; z-index: 1; }

.qr-footer {
    padding: var(--space-7) var(--space-6);
    border-top: 1px solid var(--border-subtle);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--fs-sm);
}
.qr-footer strong {
    color: var(--text-strong);
}
.qr-footer__row {
    display: flex;
    justify-content: center;
    gap: var(--space-5);
    flex-wrap: wrap;
    font-size: var(--fs-xs);
    margin-top: var(--space-2);
}
.qr-footer__row a { color: var(--text-muted); transition: color var(--dur-base); }
.qr-footer__row a:hover { color: var(--brand-bright); }

/* ========== PAGE-WIDE VIP BANNER ========== */
.vip-banner {
    background: var(--grad-surface);
    border: 1px solid var(--border-brand);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    position: relative;
    overflow: hidden;
    flex-wrap: wrap;
}
.vip-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 100% 50%, rgba(43, 102, 232, 0.18), transparent 60%);
    pointer-events: none;
}
.vip-banner__icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    background: var(--grad-brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    box-shadow: 0 10px 24px -4px rgba(43, 102, 232, 0.5);
}
.vip-banner__body { flex: 1; min-width: 200px; position: relative; z-index: 1; }
.vip-banner__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-strong); }
.vip-banner__desc { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; }

.pos-mobile-cart-toggle {
    display: none;
}

.pos-cart__close {
    display: none;
}

.pos-receipt-preview .quick-sale-payment-modal__actions {
    flex-wrap: wrap;
}

.portal-mobile-bottom-bar,
.portal-mobile-nav {
    display: none;
}

/* ========== MOBILE TWEAKS ========== */
@media (max-width: 1024px) {
    .pos-layout { grid-template-columns: 1fr; }
    .pos-cart { width: 100vw; }
    .cart-layout { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .catalog-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); }
    .pos-product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .catalog-main { padding: var(--space-5) var(--space-4); padding-bottom: 88px; }
    .cart-item { grid-template-columns: auto 64px 1fr; }
    .cart-item__image { width: 64px; height: 64px; }
    .cart-item__right { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; padding-top: var(--space-3); border-top: 1px solid var(--border-subtle); margin-top:var(--space-2); }
    .pos-cart-fab { bottom: var(--space-5); right: var(--space-4); width: 56px; height: 56px; font-size: 22px; }
    .orders-toolbar .ui-tabs {
        max-width: calc(100vw - var(--space-8));
        overflow-x: auto;
    }
    .orders-toolbar .ui-tabs::-webkit-scrollbar { display: none; }
    .qr-hero { flex-direction: column; text-align: left; }
    .qr-hero__meta { width: 100%; }
    .vip-banner { flex-direction: column; text-align: center; }
    .vip-banner__icon { margin: 0 auto; }
    .bulk-actions-bar { flex-direction: column; gap: var(--space-3); align-items: stretch; }
    .bulk-actions-bar__actions { justify-content: flex-end; }

    .quick-sale-page {
        padding-bottom: 92px;
    }

    .pos-mobile-cart-toggle {
        position: fixed;
        right: var(--space-4);
        bottom: var(--space-4);
        z-index: var(--z-sticky);
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
        padding: var(--space-3) var(--space-4);
        border: 1px solid var(--border-brand);
        border-radius: var(--radius-pill);
        background: var(--grad-brand);
        color: #fff;
        box-shadow: var(--shadow-float);
    }

    .quick-sale-cart.pos-cart {
        position: fixed;
        inset: auto 0 0 0;
        width: 100%;
        max-height: 82dvh;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        transform: translateY(105%);
        z-index: var(--z-modal);
    }

    .quick-sale-cart.pos-cart.is-mobile-open {
        transform: translateY(0);
    }

    .pos-cart__close {
        display: inline-flex;
    }

    .portal-mobile-bottom-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: var(--z-sticky);
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 0;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
        border: 0;
        border-top: 1px solid var(--border-soft);
        border-radius: 0;
        background: var(--surface-primary);
        box-shadow: 0 -8px 24px rgba(0,0,0,0.18);
    }

    .portal-mobile-bottom-bar__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        padding: 4px 2px;
        border-radius: var(--radius-sm);
        color: var(--text-muted);
        text-decoration: none;
        font-size: var(--fs-xs);
    }

    .portal-mobile-bottom-bar__item.is-active {
        color: var(--brand-glow);
        background: var(--brand-muted);
    }

    .cart-mobile-summary {
        position: fixed;
        left: var(--space-4);
        right: var(--space-4);
        bottom: calc(58px + env(safe-area-inset-bottom, 0px));
        z-index: var(--z-sticky);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-3);
        padding: var(--space-3);
        border: 1px solid var(--border-soft);
        border-radius: var(--radius-lg);
        background: var(--surface-primary);
        box-shadow: var(--shadow-float);
    }

    .cart-mobile-summary span {
        display: block;
        color: var(--text-muted);
        font-size: var(--fs-xs);
    }

    .cart-mobile-summary strong {
        color: var(--text-strong);
        font-size: var(--fs-md);
    }
}
@media (max-width: 480px) {
    .catalog-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
    .catalog-card__body { padding: var(--space-3); }
    .catalog-card__foot { padding: 0 var(--space-3) var(--space-3); }
    .catalog-card__name { font-size: var(--fs-xs); min-height: 0; }
    .catalog-card__price { font-size: var(--fs-md); }
}

.ui-icon-btn--danger:hover {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger);
}

/* ========== MINI-CART DROPDOWN ========== */
.mini-cart-wrap {
    position: relative;
}
.mini-cart {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    width: 360px;
    background: var(--surface-primary);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-float);
    z-index: var(--z-dropdown);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all var(--dur-base) var(--ease-standard);
    overflow: hidden;
}
.mini-cart.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.mini-cart__header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.legal-document-preview {
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

.legal-acceptance-preview {
    max-height: 180px;
    overflow-y: auto;
}

.stat-card__value--compact {
    font-size: var(--fs-lg);
}

.customer-quick-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}
.mini-cart__title {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-strong);
}
.mini-cart__items {
    max-height: 260px;
    overflow-y: auto;
    padding: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.mini-cart__item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-3);
    background: var(--surface-secondary);
    border-radius: var(--radius-md);
    align-items: center;
    transition: background var(--dur-base);
}
.mini-cart__item:hover { background: var(--surface-elevated); }
.mini-cart__item-thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-subtle);
    font-size: 16px;
    flex-shrink: 0;
}
.mini-cart__item-body { flex: 1; min-width: 0; }
.mini-cart__item-name { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-cart__item-meta { font-size: 11px; color: var(--text-muted); }
.mini-cart__item-price { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--brand-glow); font-variant-numeric: tabular-nums; }
.mini-cart__footer {
    padding: var(--space-3) var(--space-4);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}
.mini-cart__total {
    display: flex;
    justify-content: space-between;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-strong);
    padding: 0 var(--space-1);
}
.mini-cart__total .amt {
    color: var(--brand-glow);
    font-variant-numeric: tabular-nums;
}

/* ========== PAGE GREETING ========== */
.page-greeting {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-1);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}
.page-greeting__emoji { font-size: 1.2em; }

/* ========== LIGHT THEME — Pages Overrides ========== */
html.theme-light .login-page {
    background: var(--surface-base);
}
html.theme-light .login-bg { opacity: 0.4; }
html.theme-light .login-hero {
    background: linear-gradient(165deg, var(--surface-primary) 0%, var(--surface-base) 100%);
}
html.theme-light .login-hero__title {
    -webkit-text-fill-color: var(--text-strong);
}
html.theme-light .login-hero__feature-icon {
    background: var(--brand-muted);
    color: var(--brand);
}
html.theme-light .login-hero__feature-title { color: var(--text-strong); }
html.theme-light .login-hero__feature-sub { color: var(--text-muted); }
html.theme-light .login-hero__footer { color: var(--text-subtle); }
html.theme-light .login-hero__footer a { color: var(--text-muted); }
html.theme-light .login-hero__eyebrow {
    background: var(--brand-muted);
    color: var(--brand);
}
html.theme-light .login-form-side {
    background: var(--surface-base);
}

html.theme-light .pos-cart {
    background: var(--surface-primary);
    border-left-color: var(--border-soft);
    box-shadow: -10px 0 40px rgba(0,0,0,0.08);
}
html.theme-light .pos-cart-overlay {
    background: rgba(0, 0, 0, 0.25);
}
html.theme-light .pos-cart-item {
    background: var(--surface-secondary);
    border-color: var(--border-soft);
}
html.theme-light .pos-cart-item:hover {
    background: var(--surface-raised);
}
html.theme-light .pos-cart-item__thumb {
    background: var(--surface-raised);
    color: var(--text-subtle);
}
html.theme-light .pos-cart__totals {
    border-color: var(--border-soft);
}

html.theme-light .cart-item {
    background: var(--surface-primary);
    border-color: var(--border-soft);
}
html.theme-light .cart-item:hover {
    background: var(--surface-raised);
    border-color: var(--border-strong);
}
html.theme-light .cart-item__image {
    background: var(--surface-raised);
    color: var(--text-subtle);
}
html.theme-light .cart-summary-list {
    border-color: var(--border-soft);
}
html.theme-light .cart-info-row {
    color: var(--text-muted);
}

html.theme-light .catalog-card {
    background: var(--surface-primary);
    border-color: var(--border-soft);
    box-shadow: var(--shadow-sm);
}
html.theme-light .catalog-card:hover {
    border-color: var(--border-brand);
    box-shadow: var(--shadow-lg);
}
html.theme-light .catalog-card__image {
    background: var(--surface-raised);
}
html.theme-light .catalog-card__category { color: var(--brand); }
html.theme-light .catalog-card__stock { color: var(--text-muted); }
html.theme-light .catalog-card__stock.is-low { color: var(--danger); }
html.theme-light .catalog-card__price { color: var(--text-strong); }
html.theme-light .catalog-card__price-old { color: var(--text-subtle); }
html.theme-light .catalog-card__fav {
    background: rgba(0,0,0,0.04);
    color: var(--text-subtle);
}

html.theme-light .qr-hero {
    background: var(--surface-primary);
}
html.theme-light .qr-hero__name { color: var(--text-strong); }
html.theme-light .qr-hero__desc { color: var(--text-muted); }
html.theme-light .qr-hero__meta-item { color: var(--text-muted); }

html.theme-light .qr-cta-banner {
    background: linear-gradient(135deg, var(--surface-primary), var(--surface-raised));
    border-color: var(--border-brand);
}
html.theme-light .qr-footer {
    border-color: var(--border-soft);
    color: var(--text-subtle);
}

html.theme-light .vip-banner {
    background: linear-gradient(135deg, var(--surface-primary), var(--brand-muted));
    border-color: var(--border-brand);
}
html.theme-light .vip-banner__title { color: var(--text-strong); }
html.theme-light .vip-banner__desc { color: var(--text-muted); }
html.theme-light .vip-banner__icon {
    background: var(--brand-muted);
    color: var(--brand);
}

html.theme-light .mini-cart {
    background: var(--surface-primary);
    border-color: var(--border-soft);
    box-shadow: var(--shadow-lg);
}
html.theme-light .mini-cart__item {
    background: var(--surface-secondary);
}
html.theme-light .mini-cart__item:hover {
    background: var(--surface-raised);
}
html.theme-light .mini-cart__item-name { color: var(--text-strong); }
html.theme-light .mini-cart__item-price { color: var(--brand); }

html.theme-light .bulk-actions-bar {
    background: var(--surface-secondary);
    border-color: var(--border-soft);
}

html.theme-light .pos-qty__btn {
    background: var(--surface-raised);
    color: var(--text-strong);
    border-color: var(--border-soft);
}
html.theme-light .pos-qty__value { color: var(--text-strong); }

html.theme-light .activity-list::before {
    background: linear-gradient(180deg, var(--border-soft), var(--border-subtle));
}
html.theme-light .activity-item__dot {
    box-shadow: 0 0 0 3px var(--surface-primary);
}

html.theme-light .orders-filters .ui-chip {
    background: var(--surface-secondary);
    border-color: var(--border-soft);
    color: var(--text-primary);
}

/* ========== MEDIA LIBRARY ========== */
.media-upload-card {
    display: grid;
    gap: var(--space-4);
}

.media-upload-card__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
}

.media-cropper {
    display: grid;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--surface-secondary);
}

.media-cropper__head,
.media-cropper__aspect,
.media-cropper__actions,
.ui-image-cropper__toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.media-cropper__head {
    justify-content: space-between;
}

.media-cropper__filename {
    min-width: 0;
    overflow: hidden;
    color: var(--text-strong);
    font-weight: var(--fw-semibold);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-cropper__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
    gap: var(--space-4);
    align-items: stretch;
}

.media-cropper__preview,
.media-cropper__editor,
.ui-image-cropper {
    display: grid;
    min-height: 220px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface-primary);
}

.media-cropper__editor {
    gap: var(--space-3);
    align-content: start;
    padding: var(--space-3);
}

.media-cropper__aspect {
    justify-content: center;
}

.media-cropper__aspect .is-active,
.media-cropper__actions .is-active {
    border-color: var(--border-brand);
    color: var(--brand-bright);
}

.media-cropper__image,
.ui-image-cropper__source {
    width: 100%;
    max-height: 280px;
    object-fit: contain;
}

.ui-image-cropper {
    gap: var(--space-3);
    padding: var(--space-3);
}

.ui-image-cropper__canvas {
    position: relative;
}

.ui-image-cropper__canvas.is-focal-mode {
    cursor: crosshair;
}

.ui-image-cropper__focal {
    position: absolute;
    z-index: 2;
    width: 16px;
    height: 16px;
    border: 2px solid var(--brand-bright);
    border-radius: 999px;
    box-shadow: 0 0 0 2px var(--surface-primary);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.ui-image-cropper__toolbar {
    justify-content: center;
}

.media-cropper__status,
.ui-field-error {
    margin: 0;
    font-size: var(--fs-sm);
}

.media-cropper__status {
    color: var(--text-muted);
}

.ui-field-error {
    color: var(--danger);
}

.ui-modal-drawer {
    position: relative;
}

.ui-modal-drawer > summary {
    list-style: none;
}

.ui-modal-drawer > summary::-webkit-details-marker {
    display: none;
}

.ui-modal-drawer:not([open]) > .ui-modal-drawer__panel {
    display: none;
}

.ui-modal-drawer[open]::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(15, 23, 42, 0.36);
}

.ui-modal-drawer__panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 90;
    width: min(720px, 100vw);
    overflow-y: auto;
    padding: var(--space-5);
    background: var(--surface);
    border-left: 1px solid var(--border-subtle);
    box-shadow: -18px 0 48px rgba(15, 23, 42, 0.18);
}

.ui-modal-drawer__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.ui-modal-drawer__head h2 {
    margin: var(--space-1) 0 0;
    font-size: var(--fs-xl);
}

.ui-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.ui-form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.ui-form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-3);
}

.ui-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}

.ui-field > span {
    color: var(--text-muted);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
}

.ui-field--wide {
    grid-column: 1 / -1;
}

.ui-modal-drawer__actions {
    display: flex;
    justify-content: flex-end;
    padding-top: var(--space-2);
}

@media (max-width: 767px) {
    .ui-modal-drawer__panel {
        width: 100vw;
        padding: var(--space-4);
    }

    .ui-form-grid,
    .ui-form-grid-2,
    .ui-form-grid-3 {
        grid-template-columns: 1fr;
    }

    .ui-form-grid .ui-col-span-2,
    .ui-form-grid-2 .ui-col-span-2,
    .ui-form-grid-3 .ui-col-span-2 {
        grid-column: 1;
    }
}

.ui-definition-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
    margin: var(--space-4) 0;
}

.ui-definition-grid div {
    min-width: 0;
}

.ui-definition-grid dt {
    color: var(--text-muted);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    margin-bottom: var(--space-1);
}

.ui-definition-grid dd {
    color: var(--text-primary);
    font-size: var(--fs-sm);
    margin: 0;
}

.ui-card__head,
.ui-card__actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
}

.ui-card__actions {
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

.campaign-rule-card-grid .ui-card__foot {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.campaign-rule-card-grid .ui-card__foot > .ui-btn,
.campaign-rule-card-grid .ui-card__foot > form {
    min-width: 0;
}

.campaign-rule-card-grid .ui-card__foot > form {
    display: flex;
}

.campaign-rule-card-grid .ui-card__foot .ui-btn {
    width: 100%;
    min-width: 0;
}

.ui-row-menu__panel {
    position: absolute;
    right: 0;
    z-index: 40;
    display: grid;
    min-width: 220px;
    gap: var(--space-2);
    padding: var(--space-3);
    margin-top: var(--space-2);
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

@media (max-width: 900px) {
    .media-cropper__grid,
    .media-upload-card__grid {
        grid-template-columns: 1fr;
    }
}

/* QR menu */
.public-qr-menu {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.public-qr-menu__hero {
    display: flex;
    gap: var(--space-4);
    align-items: center;
    min-height: auto;
    padding: var(--space-5) var(--space-6);
}

.public-qr-menu__hero > .qr-hero__content {
    min-width: 0;
    flex: 1;
}

.public-qr-menu__hero > .qr-hero__meta {
    flex: 0 0 auto;
}

.public-qr-menu__cta {
    flex-shrink: 0;
}

.public-qr-menu__topbar,
.public-qr-menu__brand,
.public-qr-menu__actions,
.public-qr-menu__filters,
.public-qr-menu__categories,
.public-qr-menu__sections,
.public-qr-menu__footer {
    max-width: 100%;
}

.public-qr-menu__topbar,
.public-qr-menu__filters {
    box-sizing: border-box;
}

.public-qr-menu__brand {
    min-width: 0;
}

.public-qr-menu__brand .ui-brand-copy {
    display: flex;
    flex-direction: column;
}

.public-qr-menu__brand > span {
    min-width: 0;
}

.public-qr-menu__brand strong,
.qr-hero__name,
.catalog-card__name {
    overflow-wrap: anywhere;
}

.public-qr-menu__actions {
    min-width: 0;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
}

.public-qr-menu__language .ui-input {
    width: 136px;
    min-width: 112px;
    background: var(--surface-raised);
    color: var(--text-strong);
    border-color: var(--border-subtle);
}

.public-qr-menu__logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.public-qr-menu__eyebrow,
.public-qr-menu__address,
.public-qr-product__category,
.public-qr-product__meta {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--fs-sm);
}

.public-qr-product__category {
    color: var(--text-subtle);
    font-size: 10px;
}

.public-qr-menu__hero h1,
.public-qr-product h2,
.public-qr-product h3 {
    margin: 0;
}

.public-qr-menu__hero .qr-hero__name {
    font-size: var(--fs-xl);
    margin-bottom: 0;
}

.public-qr-menu__hero .qr-hero__desc {
    margin-top: var(--space-1);
}

.public-qr-menu__categories {
    display: block;
    margin-top: 0;
}

.public-qr-menu__filters {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.public-qr-menu__filters .ui-search {
    flex: 1 1 100%;
    min-width: 240px;
    width: 100%;
    max-width: 100%;
}

.public-qr-menu__filters .ui-input {
    flex: 1;
    min-width: 180px;
}

.public-qr-menu__sort-control {
    position: absolute;
    left: 0;
    width: 1px;
    min-width: 1px;
    max-width: 1px;
    height: 1px;
    flex: 0 0 1px;
    margin: 0;
    border: 0;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

.public-qr-menu__sort {
    justify-content: flex-end;
}

.public-qr-menu__sort .ui-label {
    margin: 0;
    color: var(--text-muted);
    font-size: var(--fs-sm);
}

.public-qr-menu__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-4);
}

.public-qr-menu__grid > * {
    min-width: 0;
}

@media (min-width: 721px) and (max-width: 900px) {
    .public-qr-menu__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.public-qr-menu__sections,
.public-qr-menu__section {
    display: grid;
    gap: var(--space-5);
}

.public-qr-product {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    background: var(--grad-surface);
}

.public-qr-product__image,
.public-qr-product__placeholder {
    width: 100%;
    height: auto;
}

.public-qr-product__image {
    object-fit: cover;
}

.public-qr-product__cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.public-qr-product__placeholder {
    display: grid;
    place-items: center;
    color: var(--text-muted);
    background: var(--surface-primary);
}

.public-qr-product__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    padding: var(--space-4);
}

.public-qr-product__head,
.public-qr-product__meta {
    display: flex;
    gap: var(--space-3);
    justify-content: space-between;
}

.public-qr-product__head strong {
    color: var(--brand-bright);
    white-space: nowrap;
}

.public-qr-product__login-hint {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.public-layout .cookie-banner [data-cookie-reject-all] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.public-qr-menu__footer-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-5);
    flex-wrap: wrap;
    width: 100%;
}

.public-qr-menu__footer {
    margin-top: 0;
}

.ui-link-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    cursor: pointer;
}

.ui-link-button:hover,
.ui-link-button:focus-visible {
    color: var(--brand-bright);
}

.text-danger {
    color: var(--danger);
}

/* POS */
.quick-sale-page {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    gap: var(--space-5);
    align-items: start;
}

.quick-sale-page__catalog,
.quick-sale-cart {
    display: grid;
    gap: var(--space-4);
}

.quick-sale-page__search {
    position: relative;
}

.quick-sale-page__search .ui-search__icon {
    position: static;
    transform: none;
    margin-right: var(--space-2);
    color: var(--text-muted);
}

.quick-sale-page__search .ui-search .ui-btn {
    flex-shrink: 0;
    margin-right: calc(var(--space-2) * -1);
}

.quick-sale-page__filters,
.quick-sale-cart__header,
.quick-sale-line,
.pos-receipt__header,
.pos-receipt__actions {
    display: flex;
    gap: var(--space-3);
}

.quick-sale-page__filters {
    flex-wrap: wrap;
}

.quick-sale-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--space-3);
}

.quick-sale-product {
    display: grid;
    grid-template-rows: 120px 1fr;
    min-height: 260px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
}

.quick-sale-product:hover:not(:disabled),
.quick-sale-product:focus-visible {
    border-color: var(--border-brand);
}

.quick-sale-product:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.quick-sale-product img,
.quick-sale-product__placeholder {
    width: 100%;
    height: 120px;
}

.quick-sale-product img {
    object-fit: cover;
}

.quick-sale-product__placeholder {
    display: grid;
    place-items: center;
    background: var(--surface-primary);
    color: var(--text-muted);
}

.quick-sale-product__body {
    display: grid;
    gap: var(--space-2);
    padding: var(--space-3);
}

.quick-sale-product__name {
    font-weight: var(--fw-semibold);
}

.quick-sale-product__meta {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    color: var(--text-muted);
    font-size: var(--fs-sm);
}

.quick-sale-cart,
.pos-receipt {
    padding: var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
}

.quick-sale-cart {
    position: sticky;
    top: var(--space-4);
}

.quick-sale-cart__header,
.pos-receipt__header {
    align-items: center;
    justify-content: space-between;
}

.quick-sale-cart__header h2,
.pos-receipt__header h2 {
    margin: var(--space-1) 0 0;
}

.quick-sale-cart__items,
.quick-sale-payment {
    display: grid;
    gap: var(--space-3);
}

.quick-sale-line {
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface-primary);
}

.quick-sale-line > div:first-child {
    display: grid;
    min-width: 0;
}

.quick-sale-line small,
.quick-sale-line span,
.quick-sale-cart__empty {
    color: var(--text-muted);
}

.quick-sale-line__qty {
    display: grid;
    grid-template-columns: 36px 72px 36px;
    gap: var(--space-2);
    align-items: center;
}

.quick-sale-line__qty .ui-input {
    text-align: center;
}

.quick-sale-cart__empty {
    display: grid;
    min-height: 180px;
    place-items: center;
    text-align: center;
}

.quick-sale-summary,
.pos-receipt__totals {
    display: grid;
    gap: var(--space-2);
    margin: 0;
}

.quick-sale-summary div,
.pos-receipt__totals div {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
}

.quick-sale-summary .is-total,
.pos-receipt__totals .is-total {
    padding-top: var(--space-2);
    border-top: 1px solid var(--border-subtle);
    color: var(--text-strong);
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
}

.ui-alert {
    margin: 0;
    padding: var(--space-3);
    border-radius: var(--radius-md);
}

.ui-alert--danger {
    border: 1px solid rgba(220, 38, 38, 0.45);
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    color: var(--danger);
}

.ui-alert--success {
    border: 1px solid rgba(22, 163, 74, 0.45);
    background: color-mix(in srgb, var(--success) 12%, transparent);
    color: var(--success);
}

/* Dashboard widgets */
.dashboard-widgets-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.dashboard-widget,
.dashboard-chart-card {
    display: grid;
    gap: var(--space-4);
}

.dashboard-widget__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
}

.dashboard-bars {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: var(--space-3);
    min-height: 220px;
    align-items: end;
}

.dashboard-bars__item {
    display: grid;
    gap: var(--space-2);
    min-width: 0;
    text-align: center;
}

.dashboard-bars__bar {
    display: block;
    min-height: 6px;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    background: var(--brand-bright);
}

.dashboard-bars__item small,
.dashboard-activity small,
.ui-list__item small {
    display: block;
    color: var(--text-muted);
}

.dashboard-share-list,
.dashboard-activity {
    display: grid;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.dashboard-share-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(120px, 220px) auto;
    gap: var(--space-3);
    align-items: center;
}

.dashboard-share-list__track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-primary);
}

.dashboard-share-list__track span {
    display: block;
    height: 100%;
    width: var(--ratio-w, 0%);
    border-radius: inherit;
    background: var(--brand-bright);
}

.dashboard-activity li {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    gap: var(--space-3);
}

.dashboard-activity__dot {
    width: 10px;
    height: 10px;
    margin-top: .35rem;
    border-radius: 999px;
    background: var(--brand-bright);
}

@media (max-width: 1100px) {
    .quick-sale-page,
    .dashboard-widgets-grid {
        grid-template-columns: 1fr;
    }

    .quick-sale-cart {
        position: static;
    }
}

@media (max-width: 720px) {
    .public-qr-menu__hero,
    .public-qr-menu__filters,
    .public-qr-product__head,
    .public-qr-product__meta,
    .quick-sale-cart__header,
    .pos-receipt__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-bars {
        min-height: 180px;
        overflow-x: auto;
    }

    .dashboard-bars__item {
        min-width: 72px;
    }

    .dashboard-share-list li {
        grid-template-columns: 1fr;
    }

    .public-qr-menu {
        padding: 0;
        width: 100%;
        overflow-x: hidden;
    }

    .public-qr-menu__topbar {
        padding: var(--space-4) var(--space-6);
        align-items: center;
        justify-content: space-between;
        gap: var(--space-2);
        overflow: hidden;
    }

    .public-qr-menu__actions {
        gap: var(--space-2);
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        flex: 0 0 auto;
        max-width: none;
    }

    .public-qr-menu__cta {
        min-width: auto;
        padding-inline: var(--space-3);
        width: auto;
        justify-content: center;
    }

    .public-qr-menu__filters {
        display: flex;
        grid-template-columns: none;
        align-items: center;
        width: 100%;
        overflow: hidden;
    }

    .public-qr-menu__filters .ui-input {
        min-width: 0;
        width: 100%;
    }

    .public-qr-menu__filters .public-qr-menu__sort-control {
        left: 0;
        width: 1px;
        min-width: 1px;
        max-width: 1px;
    }

    .public-qr-menu__filters .ui-btn {
        width: 100%;
        justify-content: center;
    }

    .public-qr-menu__categories {
        margin-top: 0;
    }

    .public-qr-menu__categories .catalog-categories-inner {
        padding-inline: var(--space-3);
    }

    .public-qr-menu__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: var(--space-2) !important;
    }

    .public-qr-menu__grid > *,
    .public-qr-product,
    .public-qr-product__body,
    .catalog-card__body,
    .catalog-card__foot {
        min-width: 0;
    }

    .public-qr-menu__hero {
        padding: var(--space-5) var(--space-6);
        min-height: 224px;
    }

    .public-qr-menu__logo {
        width: 44px;
        height: 44px;
    }

    .public-qr-product {
        display: flex;
    }

    .public-qr-product__body {
        padding: var(--space-3) !important;
    }

    .public-qr-product__image,
    .public-qr-product__placeholder {
        height: auto;
    }
}

/* ── Dropdown (row actions) ───────────────────────────────────────────── */
.ui-dropdown { position: relative; display: inline-block; }
.ui-dropdown__menu {
    position: absolute;
    right: 0;
    top: 100%;
    z-index: 50;
    background: var(--surface-1, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 0.5rem);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    min-width: 160px;
    padding: 0.25rem 0;
    margin-top: 0.25rem;
}
.ui-dropdown__menu.hidden { display: none; }
.ui-dropdown__item,
.ui-dropdown__btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary, #1e293b);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
}
.ui-dropdown__item:hover,
.ui-dropdown__btn:hover { background: var(--surface-hover, #f1f5f9); }
.ui-dropdown__form { margin: 0; padding: 0; }

/* ── KPI Spark + Trend ─────────────────────────────────────────────────── */
.ui-kpi__spark {
    display: block;
    width: 100%;
    height: 32px;
    color: var(--primary);
    opacity: 0.7;
}

.ui-kpi__spark svg {
    width: 100%;
    height: 100%;
}

.ui-kpi__trend {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    margin-left: 0.25rem;
    vertical-align: middle;
}
.ui-kpi__trend.is-positive { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.ui-kpi__trend.is-negative { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }

.quick-sale-page { display: grid; grid-template-columns: 1fr; gap: var(--space-5); min-height: calc(100vh - var(--topbar-height) - var(--space-7) * 2); }
.quick-sale-page__catalog { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.quick-sale-page__filters { display: flex; flex-wrap: nowrap; gap: var(--space-2); overflow-x: auto; padding-bottom: var(--space-2); scroll-snap-type: x mandatory; }
.quick-sale-page__filters .ui-chip { scroll-snap-align: start; flex-shrink: 0; }
.quick-sale-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-3); }
.quick-sale-product { background: var(--grad-surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; transition: all var(--dur-smooth) var(--ease-bounce); position: relative; display: flex; flex-direction: column; box-shadow: var(--shadow-xs); text-align: left; padding: 0; }
.quick-sale-product::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 50% 0%, rgba(43,102,232,0.12), transparent 70%); opacity: 0; transition: opacity var(--dur-base); pointer-events: none; z-index: 1; }
.quick-sale-product:hover { transform: translateY(-4px); border-color: var(--border-brand); box-shadow: 0 14px 28px -8px rgba(0,0,0,0.55), 0 0 24px rgba(43,102,232,0.2); }
.quick-sale-product:hover::before { opacity: 1; }
.quick-sale-product:active { transform: translateY(-2px) scale(0.98); }
.quick-sale-product.is-disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }
.quick-sale-product img { aspect-ratio: 4/3; object-fit: cover; width: 100%; display: block; }
.quick-sale-product__placeholder { aspect-ratio: 4/3; background: var(--surface-raised); display: flex; align-items: center; justify-content: center; color: var(--text-subtle); font-size: 32px; position: relative; overflow: hidden; }
.quick-sale-product__placeholder::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.3)); }
.quick-sale-product__body { padding: var(--space-3); display: flex; flex-direction: column; gap: 4px; position: relative; z-index: 2; }
.quick-sale-product__name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.6em; }
.quick-sale-product__meta { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--text-muted); }
.quick-sale-product strong { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--brand-glow); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.quick-sale-cart { background: var(--surface-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-xl); display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4); position: sticky; top: var(--space-5); max-height: calc(100vh - var(--topbar-height) - var(--space-7)); overflow: hidden; box-shadow: var(--shadow-md); }
.quick-sale-customer__tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.quick-sale-customer__picker { position: relative; }
.quick-sale-customer__list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--surface-elevated); border: 1px solid var(--border-soft); border-radius: var(--radius-md); max-height: 200px; overflow-y: auto; box-shadow: var(--shadow-lg); list-style: none; padding: 0; margin: 0; }
.quick-sale-customer__item { padding: var(--space-2) var(--space-3); cursor: pointer; font-size: var(--fs-sm); display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--border-subtle); }
.quick-sale-customer__item:last-child { border-bottom: 0; }
.quick-sale-customer__item:hover { background: var(--surface-secondary); }
.quick-sale-customer__item.is-selected { background: var(--brand-muted); }
.quick-sale-customer__new { display: flex; flex-direction: column; gap: var(--space-2); }
.quick-sale-customer__badge { display: flex; align-items: center; gap: var(--space-2); }
.quick-sale-coupon { display: flex; flex-direction: column; gap: var(--space-1); }
.quick-sale-coupon span { font-size: var(--fs-xs); color: var(--text-muted); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: 0.06em; }
.quick-sale-cart__header { display: flex; justify-content: space-between; align-items: center; }
.quick-sale-cart__header h2 { font-size: var(--fs-sm); color: var(--text-muted); margin-top: var(--space-1); }
.quick-sale-cart__items { display: flex; flex-direction: column; gap: var(--space-3); overflow-y: auto; }
.quick-sale-line { display: grid; grid-template-columns: 1fr auto auto; gap: var(--space-2); align-items: center; padding: var(--space-2); background: var(--surface-secondary); border-radius: var(--radius-md); }
.quick-sale-line__qty { display: flex; align-items: center; gap: var(--space-1); }
.quick-sale-line__qty .ui-input { width: 60px; text-align: center; padding: 4px; }
.quick-sale-cart__empty { text-align: center; color: var(--text-muted); padding: var(--space-5); }
.quick-sale-cart__footer { margin-top: auto; padding-top: var(--space-3); border-top: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: var(--space-3); }
.quick-sale-summary { display: flex; flex-direction: column; gap: var(--space-2); font-size: var(--fs-sm); }
.quick-sale-summary div { display: flex; justify-content: space-between; }
.quick-sale-summary dt { color: var(--text-muted); }
.quick-sale-summary dd { font-weight: var(--fw-semibold); color: var(--text-strong); }
.quick-sale-summary .is-total { font-size: var(--fs-lg); font-weight: var(--fw-bold); padding-top: var(--space-2); border-top: 1px solid var(--border-soft); }
.quick-sale-summary .is-total dd { color: var(--brand-glow); }
.quick-sale-summary .is-danger { color: var(--danger); }
.quick-sale-payment-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
.quick-sale-payment-modal__overlay { position: absolute; inset: 0; background: rgba(7,10,19,0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.quick-sale-payment-modal__dialog { position: relative; width: min(100%, 520px); background: var(--surface-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-xl); box-shadow: var(--shadow-xl); display: flex; flex-direction: column; max-height: 90vh; }
.quick-sale-payment-modal__header { display: flex; justify-content: space-between; align-items: center; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-soft); }
.quick-sale-payment-modal__header h3 { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.quick-sale-payment-modal__body { padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); overflow-y: auto; }
.quick-sale-payment-modal .ui-field { display: flex; flex-direction: column; gap: var(--space-1); }
.quick-sale-payment-modal .ui-field span { font-size: var(--fs-xs); color: var(--text-muted); font-weight: var(--fw-semibold); text-transform: uppercase; letter-spacing: 0.06em; }
.quick-sale-payment-modal .ui-alert { margin: 0; }
@media (min-width: 1024px) { .quick-sale-page { grid-template-columns: 3fr 2fr; } }
@media (max-width: 1023px) { .quick-sale-cart { position: relative; top: 0; } }

/* ── Dashboard Quick Actions (2×2 grid) ──────────────────────────────── */
.dashboard-quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}
@media (max-width: 900px) {
    .dashboard-quick-actions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .dashboard-quick-actions { grid-template-columns: 1fr; }
}

/* ── Orders Filter Grid ──────────────────────────────────────────────── */
.orders-filter-panel {
    margin-bottom: var(--space-5);
    padding: var(--space-3);
    background: var(--surface-secondary);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
}
.orders-filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.35fr) repeat(5, max-content);
    gap: var(--space-2);
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    margin-bottom: 0;
    align-items: end;
}
.orders-filter-grid .ui-field:not(.orders-filter-grid__search),
.orders-filter-grid__actions {
    display: none;
}
.orders-filter-grid__search {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    min-width: 0;
}
.orders-filter-grid.is-expanded {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-3);
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    align-items: end;
}
.orders-filter-grid.is-expanded > .ui-chip {
    justify-self: start;
}
.orders-filter-grid.is-expanded .ui-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}
.orders-filter-grid .ui-field > span {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.orders-filter-grid .ui-field--inline {
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
}
.orders-filter-grid.is-expanded .orders-filter-grid__actions {
    display: flex;
    gap: var(--space-2);
    align-items: end;
}
@media (max-width: 640px) {
    .orders-filter-grid { grid-template-columns: 1fr 1fr; }
    .orders-filter-grid__search { grid-column: 1 / -1; }
    .orders-filter-grid.is-expanded { grid-template-columns: 1fr 1fr; }
    .orders-filter-grid.is-expanded .orders-filter-grid__actions { grid-column: 1 / -1; }
}

@media (max-width: 1199px) {
    .orders-toolbar__left {
        flex-basis: 100%;
        width: 100%;
    }

    .orders-status-tabs {
        max-width: 100%;
    }
}

/* ── Orders Status Tabs ──────────────────────────────────────────────── */
.orders-status-tabs {
    display: flex;
    gap: var(--space-2);
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    width: 100%;
    max-width: 739px;
}

.orders-status-tabs::-webkit-scrollbar {
    display: none;
}

.orders-status-tabs .ui-tabs__item {
    flex: 0 0 auto;
}

.orders-table-card {
    padding: 0;
}

.orders-table-card .orders-table__select {
    width: 40px;
}

.orders-table-card .orders-table__actions-head {
    width: 80px;
}

.orders-table-card .ui-table-scroll {
    min-height: 531px;
}

@media (min-width: 993px) and (max-width: 1199px) {
    .orders-table-card .ui-table-scroll {
        min-height: 563px;
    }
}

@media (min-width: 641px) and (max-width: 992px) {
    .orders-table-card .ui-table-scroll {
        min-height: 686px;
    }
}

@media (max-width: 640px) {
    .orders-table-card .ui-table-scroll {
        min-height: 686px;
    }
}

/* ── Orders Action Menu ──────────────────────────────────────────────── */
.orders-action-menu .ui-dropdown__menu {
    min-width: 180px;
}

/* ── Portal Catalog ──────────────────────────────────────────────────── */
.portal-catalog-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
    margin-bottom: var(--space-4);
}
.portal-catalog-toolbar__left { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.portal-catalog-toolbar__right { display: flex; align-items: center; gap: var(--space-2); }
.portal-view-toggle { display: inline-flex; align-items: center; gap: var(--space-1); }
.portal-view-toggle .ui-icon-btn.is-active {
    color: var(--brand-glow);
    border-color: var(--border-brand);
    background: var(--brand-muted);
}

.portal-category-chips {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    padding-bottom: var(--space-2);
    scroll-snap-type: x mandatory;
    margin-bottom: var(--space-4);
}
.portal-category-chips .ui-chip { scroll-snap-align: start; flex-shrink: 0; }

.ui-promotion-banners {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.ui-promotion-banner {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    padding: var(--space-4);
    border: 1px solid var(--border-brand);
    border-radius: var(--radius-lg);
    background: var(--grad-brand-soft);
}

.ui-promotion-banner .icon { color: var(--brand-glow); font-size: 22px; }
.ui-promotion-banner strong { display: block; color: var(--text-strong); }
.ui-promotion-banner span { display: block; margin-top: 2px; color: var(--text-muted); font-size: var(--fs-sm); }

.portal-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-4);
}
.portal-product-grid--list { grid-template-columns: 1fr; }
.portal-product-grid--list .portal-product-card {
    display: grid;
    grid-template-columns: minmax(140px, 220px) minmax(0, 1fr) auto;
    align-items: stretch;
}
.portal-product-grid--list .portal-product-card__image { aspect-ratio: auto; min-height: 150px; }
.portal-product-grid--list .portal-product-card__actions {
    flex-direction: column;
    justify-content: center;
    border-top: 0;
    border-left: 1px solid var(--border-soft);
    min-width: 220px;
}
@media (max-width: 760px) {
    .portal-product-grid--list .portal-product-card {
        grid-template-columns: 1fr;
    }
    .portal-product-grid--list .portal-product-card__image { aspect-ratio: 4/3; }
    .portal-product-grid--list .portal-product-card__actions {
        flex-direction: row;
        justify-content: space-between;
        border-left: 0;
        border-top: 1px solid var(--border-soft);
        min-width: 0;
    }
}

.portal-product-card {
    background: var(--grad-surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xs);
    transition: all var(--dur-smooth) var(--ease-bounce);
    position: relative;
}
.portal-product-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-brand);
    box-shadow: 0 14px 28px -8px rgba(0,0,0,0.55), 0 0 24px rgba(43,102,232,0.2);
}
.portal-product-card__image {
    aspect-ratio: 4/3;
    background: var(--surface-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-subtle);
    font-size: 32px;
    position: relative;
    overflow: hidden;
}
.portal-product-card__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portal-product-card__badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    background: rgba(0,0,0,0.6);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-xs);
    font-size: 10px;
    font-weight: var(--fw-semibold);
    color: #fff;
    z-index: 2;
}
.portal-product-card__body { padding: var(--space-3); display: flex; flex-direction: column; gap: 4px; }
.portal-product-card__name {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-strong);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 2.6em;
}
.portal-product-card__name a { color: inherit; text-decoration: none; }
.portal-product-card__meta { font-size: var(--fs-xs); color: var(--text-muted); margin: 0; }
.portal-product-card__price { display: flex; align-items: baseline; gap: var(--space-2); }
.portal-product-card__price strong { font-size: var(--fs-md); font-weight: var(--fw-bold); color: var(--brand-glow); }
.portal-product-card__price small { font-size: var(--fs-xs); color: var(--text-muted); }
.portal-product-card__actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-2) var(--space-3);
    border-top: 1px solid var(--border-soft);
    gap: var(--space-2);
}
.portal-favorite-toggle .ui-btn--icon { width: 36px; height: 36px; }
.portal-add-to-cart { display: flex; align-items: center; gap: var(--space-2); }
.portal-add-to-cart .ui-input--qty { width: 60px; text-align: center; }

.portal-quick-view-modal[hidden] { display: none; }
.portal-quick-view-modal {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}
.portal-quick-view-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
}
.portal-quick-view-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(920px, 100%);
    max-height: min(760px, calc(100vh - 32px));
    overflow: auto;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: var(--surface-primary);
    box-shadow: var(--shadow-float);
}
.portal-quick-view-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4);
    border-bottom: 1px solid var(--border-soft);
}
.portal-quick-view-modal__head h2 { margin: var(--space-2) 0 0; font-size: var(--fs-xl); }
.portal-quick-view-modal__body {
    display: grid;
    grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
    gap: var(--space-4);
    padding: var(--space-4);
}
.portal-quick-view-modal__media {
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--surface-secondary);
    color: var(--text-subtle);
    font-size: 40px;
    overflow: hidden;
}
.portal-quick-view-modal__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portal-quick-view-modal__content { display: grid; gap: var(--space-3); align-content: start; }
.portal-quick-view-modal__meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
    margin: 0;
}
.portal-quick-view-modal__meta div {
    padding: var(--space-3);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--surface-secondary);
}
.portal-quick-view-modal__meta dt { color: var(--text-muted); font-size: var(--fs-xs); }
.portal-quick-view-modal__meta dd { margin: var(--space-1) 0 0; color: var(--text-strong); font-weight: var(--fw-semibold); }
.portal-quick-view-modal__cart { display: flex; align-items: center; gap: var(--space-2); }
.portal-quick-view-modal__cart .ui-input--qty { width: 72px; text-align: center; }
@media (max-width: 760px) {
    .portal-quick-view-modal { align-items: flex-end; padding: var(--space-2); }
    .portal-quick-view-modal__dialog { max-height: calc(100vh - 16px); }
    .portal-quick-view-modal__body,
    .portal-quick-view-modal__meta {
        grid-template-columns: 1fr;
    }
}

/* ── Portal Cart Sidebar / Sticky ──────────────────────────────────── */
.portal-cart-sidebar { position: sticky; top: var(--space-5); }
.portal-mini-cart.pos-cart {
    position: static;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    background: var(--surface-primary);
    background-image: none;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transform: none;
    transition: none;
    z-index: auto;
    overflow: hidden;
}
.portal-mini-cart.pos-cart.is-open { transform: none; }
.portal-mini-cart .pos-cart__head {
    background: transparent;
}
.portal-mini-cart .pos-cart__items {
    flex: initial;
    min-height: 0;
}

/* ── Portal Mobile Nav ─────────────────────────────────────────────── */
.portal-mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    background: var(--surface-primary);
    border: 0;
    border-top: 1px solid var(--border-soft);
    border-radius: 0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.18);
}
.portal-mobile-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: var(--fs-xs);
    text-decoration: none;
    padding: 4px 2px;
    border-radius: var(--radius-sm);
    position: relative;
    transition: color var(--dur-base);
}
.portal-mobile-nav__item.is-active { color: var(--brand-glow); }
.portal-mobile-nav__item i { font-size: 20px; }
.portal-mobile-nav__badge {
    position: absolute;
    top: -2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    font-weight: var(--fw-bold);
    display: flex;
    align-items: center;
    justify-content: center;
}
@media (max-width: 768px) {
    .portal-mobile-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
    }
    .shell__content { padding-bottom: calc(var(--space-6) + 72px + env(safe-area-inset-bottom, 0px)); }
}

/* ── Portal Orders ─────────────────────────────────────────────────── */
.portal-orders-filter .ui-toolbar__left { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.portal-order-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }

.ui-image-preview {
    display: block;
    max-width: 200px;
    border-radius: var(--radius-md);
}

.ui-image-preview--spaced { margin-bottom: var(--space-2); }

/* ── Portal Order Detail ───────────────────────────────────────────── */
#refund-form { margin-bottom: var(--space-5); }
#refund-form .ui-field { margin-bottom: var(--space-3); }
#refund-form .ui-field label { display: block; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-muted); margin-bottom: var(--space-1); }
#refund-form textarea { min-height: 80px; }
.refund-request-form { max-width: 720px; }

/* ========== QUICK SALE / POS ========== */
.quick-sale-page {
    display: block;
    min-height: calc(100vh - var(--topbar-height) - var(--space-7));
}

.quick-sale-page__form,
.pos-layout__form {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: var(--space-5);
    min-width: 0;
}

@media (min-width: 1024px) {
    .quick-sale-page__form,
    .pos-layout__form {
        grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr);
    }
}

.quick-sale-page.is-enhanced .quick-sale-page__form,
.quick-sale-page.is-enhanced .pos-layout__form {
    display: block;
}

.quick-sale-page__catalog { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.quick-sale-page__search,
.quick-sale-page__search.catalog-search-row {
    position: relative;
    top: auto;
    z-index: auto;
    margin: 0;
    padding: 0;
    background: transparent;
}
.quick-sale-page__filters { display: flex; flex-wrap: nowrap; gap: var(--space-2); overflow-x: auto; padding-bottom: var(--space-2); scroll-snap-type: x mandatory; }
.quick-sale-page__filters .ui-chip { scroll-snap-align: start; flex-shrink: 0; }
.quick-sale-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-4); margin-bottom: var(--space-7); }
.quick-sale-grid.pos-product-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-4); }
.quick-sale-product {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-xl);
    background: var(--grad-surface);
    cursor: pointer;
    text-align: left;
    overflow: hidden;
    transition: all var(--dur-smooth) var(--ease-bounce);
    min-width: 0;
    box-shadow: var(--shadow-xs);
    color: inherit;
    line-height: 1.55;
}
.quick-sale-product.catalog-card.pos-product-card {
    min-height: 0;
    padding: 0;
}
.quick-sale-product::before {
    top: 0;
    left: 30%;
    right: 30%;
    bottom: auto;
    width: auto;
    height: 1px;
    background: var(--grad-accent-line);
    opacity: 0;
    z-index: 2;
}
.quick-sale-product:hover:not(.is-disabled) {
    transform: translateY(-6px);
    border-color: var(--border-brand);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5), 0 0 30px rgba(43,102,232,0.18);
}
.quick-sale-product:hover:not(.is-disabled)::before { opacity: 1; }
.quick-sale-product.is-disabled { opacity: 1; cursor: not-allowed; }
.quick-sale-product img,
.quick-sale-product.catalog-card.pos-product-card img {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 0;
}
.quick-sale-product__placeholder,
.quick-sale-product__placeholder.catalog-card__image.pos-product-card__image {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--surface-raised), var(--surface-elevated));
    border-radius: 0;
    color: var(--text-subtle);
    font-size: 36px;
}
.quick-sale-product__body { display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 0; padding: var(--space-4); }
.quick-sale-product__name { font-weight: var(--fw-semibold); font-size: var(--fs-sm); color: var(--text-strong); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.6em; }
.quick-sale-product .catalog-card__price { font-size: var(--fs-lg); font-weight: var(--fw-black); }
.quick-sale-product__meta { display: flex; justify-content: space-between; gap: var(--space-2); font-size: var(--fs-xs); color: var(--text-muted); }
.quick-sale-product__meta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-sale-product__cta { margin-top: auto; }

@media (max-width: 640px) {
    .quick-sale-grid.pos-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: var(--space-3);
    }
}

@media (max-width: 480px) {
    .quick-sale-grid,
    .quick-sale-grid.pos-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-2);
    }
    .quick-sale-product__body { padding: var(--space-3); }
    .quick-sale-product__name { font-size: var(--fs-xs); min-height: 0; }
    .quick-sale-product__placeholder,
    .quick-sale-product__placeholder.catalog-card__image.pos-product-card__image { font-size: 36px; }
    .quick-sale-product .catalog-card__price { font-size: var(--fs-md); }
}

.quick-sale-cart {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    position: sticky;
    top: var(--space-4);
    max-height: calc(100vh - var(--topbar-height) - var(--space-6));
    overflow: hidden;
}
.quick-sale-cart.pos-cart {
    right: auto;
    width: auto;
    max-width: none;
    height: auto;
    min-height: 0;
    padding: var(--space-4);
    background: var(--surface-raised);
    background-image: none;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    transform: none;
    transition: none;
    z-index: auto;
}
.quick-sale-page.is-enhanced .quick-sale-cart.pos-cart {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(100vw, 420px);
    height: 100vh;
    max-height: none;
    max-width: none;
    padding: var(--space-4);
    border-radius: var(--radius-xl) 0 0 var(--radius-xl);
    border-right: 0;
    box-shadow: var(--shadow-xl);
    transform: translateX(104%);
    transition: transform var(--dur-base);
    z-index: 60;
}
.quick-sale-cart.pos-cart.is-open,
.quick-sale-page.is-enhanced .quick-sale-cart.pos-cart.is-open { transform: none; }
.quick-sale-cart__header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.quick-sale-cart__header.pos-cart__head { padding: 0; background: transparent; border-bottom: 0; }
.quick-sale-cart__close { display: none; }
.quick-sale-page.is-enhanced .quick-sale-cart__close { display: inline-flex; }
.quick-sale-cart__items { display: flex; flex-direction: column; gap: var(--space-2); flex: 1; overflow-y: auto; min-height: 180px; }
.quick-sale-cart__items.pos-cart__items { padding: 0; }
.quick-sale-cart__empty {
    display: flex;
    min-height: 160px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-6) var(--space-4);
    color: var(--text-muted);
    text-align: center;
    border: 1px dashed var(--border-soft);
    border-radius: var(--radius-md);
}
.quick-sale-cart__empty p { margin: 0; }
.quick-sale-cart__footer { display: flex; flex-direction: column; gap: var(--space-3); border-top: 1px solid var(--border-soft); padding-top: var(--space-4); }

.quick-sale-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: var(--space-3); align-items: center; padding: var(--space-2) var(--space-3); background: var(--surface-secondary); border: 1px solid var(--border-soft); border-radius: var(--radius-md); }
.quick-sale-line__qty { display: flex; align-items: center; gap: var(--space-1); }
.quick-sale-line__qty .ui-input { width: 56px; text-align: center; }

.quick-sale-customer { display: flex; flex-direction: column; gap: var(--space-3); }
.quick-sale-customer__tabs { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.quick-sale-customer__picker { position: relative; }
.quick-sale-customer__list { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; max-height: 200px; overflow-y: auto; background: var(--surface-raised); border: 1px solid var(--border-soft); border-radius: var(--radius-md); box-shadow: var(--shadow-float); }
.quick-sale-customer__item { padding: var(--space-2) var(--space-3); cursor: pointer; transition: background var(--dur-base); display: flex; justify-content: space-between; align-items: center; }
.quick-sale-customer__item:hover, .quick-sale-customer__item.is-selected { background: var(--brand-muted); }
.quick-sale-customer__new { display: flex; flex-direction: column; gap: var(--space-2); }
.quick-sale-customer__badge { display: flex; align-items: center; gap: var(--space-2); }

.quick-sale-coupon { display: flex; flex-direction: column; gap: var(--space-1); }
.quick-sale-coupon span { font-size: var(--fs-xs); color: var(--text-muted); font-weight: var(--fw-semibold); }

.quick-sale-page.is-enhanced .pos-js-fallback { display: none; }
.pos-cart-fab {
    display: none;
    position: fixed;
    right: var(--space-6);
    bottom: var(--space-6);
    width: 64px;
    height: 64px;
    border: none;
    border-radius: 50%;
    background: var(--grad-brand);
    color: #fff;
    box-shadow: 0 12px 32px -6px rgba(43, 102, 232, 0.65), inset 0 1px 0 rgba(255,255,255,0.25);
    cursor: pointer;
    z-index: 55;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    transition: all var(--dur-base) var(--ease-bounce);
    animation: fabPulse 3s ease-in-out infinite;
}
.quick-sale-page.is-enhanced .pos-cart-fab { display: inline-flex; }
.pos-cart-fab__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: var(--fw-bold);
    box-shadow: 0 4px 10px rgba(225,76,76,0.5);
    border: 2px solid var(--surface-base);
}

@media (max-width: 767px) {
    .quick-sale-page .pos-cart-fab {
        right: var(--space-4);
        bottom: var(--space-5);
        width: 56px;
        height: 56px;
        font-size: 22px;
    }
}

.pos-cart-overlay {
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(7, 10, 19, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    z-index: 58;
    cursor: pointer;
}
.pos-cart-overlay[hidden] { display: none; }
.quick-sale-summary { display: flex; flex-direction: column; gap: var(--space-1); }
.quick-sale-summary > div { display: flex; justify-content: space-between; font-size: var(--fs-sm); }
.quick-sale-summary > div:last-child { font-weight: var(--fw-bold); font-size: var(--fs-base); color: var(--text-strong); border-top: 1px solid var(--border-soft); padding-top: var(--space-2); margin-top: var(--space-1); }
.quick-sale-summary > div.is-total { font-weight: var(--fw-bold); font-size: var(--fs-base); color: var(--text-strong); border-top: 1px solid var(--border-soft); padding-top: var(--space-2); margin-top: var(--space-1); }
.quick-sale-summary .is-danger { color: var(--danger); }

.quick-sale-payment-modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
.quick-sale-payment-modal__overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); }
.quick-sale-payment-modal__dialog { position: relative; z-index: 1; width: min(100%, 480px); background: var(--surface-primary); border: 1px solid var(--border-soft); border-radius: var(--radius-2xl); box-shadow: var(--shadow-float); overflow: hidden; }
.quick-sale-payment-modal__dialog--compact { max-width: 24rem; }
.quick-sale-payment-modal__header { display: flex; align-items: center; justify-content: space-between; padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border-soft); }
.quick-sale-payment-modal__body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }
.quick-sale-payment-modal__actions { display: flex; gap: var(--space-2); margin-top: var(--space-4); }

/* ========== CUSTOMER LIFECYCLE ========== */
.ui-select {
    min-height: 44px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--surface-secondary);
    color: var(--text-strong);
    padding: 10px var(--space-4);
    font-size: var(--fs-sm);
}
.ui-filter-drawer { position: relative; }
.ui-filter-drawer summary { list-style: none; }
.ui-filter-drawer summary::-webkit-details-marker { display: none; }
.ui-filter-drawer__body {
    position: absolute;
    top: calc(100% + var(--space-2));
    left: 0;
    z-index: 20;
    width: min(360px, 90vw);
    display: grid;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: var(--surface-raised);
    box-shadow: var(--shadow-float);
}
.ui-filter-drawer__body label { display: grid; gap: var(--space-1); color: var(--text-muted); font-size: var(--fs-sm); }
.ui-filter-drawer__body input,
.ui-filter-drawer__body select {
    min-height: 36px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--surface-primary);
    padding: 0 var(--space-3);
}
.ui-filter-drawer__title { font-weight: var(--fw-semibold); color: var(--text-strong); }
.ui-bulk-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin: var(--space-3) 0;
    padding: var(--space-3);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: var(--surface-secondary);
}
.ui-bulk-bar span { color: var(--text-muted); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.ui-list-table__select { width: 42px; text-align: center; }
.ui-section-head,
.ui-inline-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
}
.ui-note-form {
    display: grid;
    gap: var(--space-2);
    max-width: 720px;
}
.ui-note-form textarea {
    width: 100%;
    min-height: 92px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--surface-primary);
    color: var(--text-strong);
    padding: var(--space-3);
}
.ui-note-log pre {
    white-space: pre-wrap;
    margin: var(--space-4) 0 0;
    padding: var(--space-4);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: var(--surface-secondary);
    color: var(--text-strong);
}
.ui-metric-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}
.ui-metric-row article {
    display: grid;
    gap: var(--space-1);
    padding: var(--space-3);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    background: var(--surface-secondary);
}
.ui-metric-row span { color: var(--text-muted); font-size: var(--fs-sm); }
.ui-metric-row strong { color: var(--text-strong); font-size: var(--fs-lg); }
@media (max-width: 720px) {
    .ui-filter-drawer__body { position: fixed; inset: auto var(--space-3) var(--space-3); width: auto; }
    .ui-bulk-bar { align-items: stretch; }
}

/* ========== PRODUCT LIFECYCLE CONTROLS ========== */
.ui-switch-button {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    gap: var(--space-2);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-pill);
    background: var(--surface-secondary);
    color: var(--text-muted);
    padding: 0 var(--space-3);
    font: inherit;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    cursor: pointer;
}

.ui-switch-button::before {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-subtle);
    box-shadow: inset 0 0 0 5px var(--surface-raised);
}

.ui-switch-button.is-on {
    border-color: var(--success);
    background: color-mix(in srgb, var(--success) 12%, transparent);
    color: var(--success);
}

.ui-switch-button.is-on::before {
    background: var(--success);
}

.product-quick-stock {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    max-width: 180px;
}

.product-quick-stock .ui-input {
    width: 72px;
    min-height: 32px;
}

.ui-customer-card__foot .product-quick-stock {
    flex: 0 1 98px;
    max-width: 98px;
    min-width: 0;
}

.ui-customer-card__foot .product-quick-stock .ui-input {
    width: 58px;
}

.ui-customer-card__foot .product-quick-stock .ui-btn--icon {
    flex: 0 0 auto;
    width: 32px;
}

.ui-customer-card__foot .products-action-menu {
    flex: 0 0 auto;
}

.ui-rich-text {
    display: grid;
    gap: var(--space-2);
}

.ui-rich-text__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.ui-rich-text__editor {
    min-height: 148px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--surface-raised);
    color: var(--text-strong);
    padding: var(--space-3);
    line-height: var(--line-height-relaxed);
}

.ui-rich-text__editor:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-muted);
    outline: none;
}

.ui-media-strip,
.ui-linked-list {
    display: grid;
    gap: var(--space-2);
}

.ui-media-strip__item,
.ui-linked-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--surface-secondary);
}

.ui-media-strip__item img {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.signup-request-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1);
}

.signup-reject-dialog {
    max-width: 480px;
}
