/* Portal v18 — Customer club aligned with the light showroom UI */
.portal-app,
.portal-auth-screen {
    margin: 0;
    background:
        radial-gradient(circle at 18% 0%, rgba(212,175,55,0.18), transparent 30rem),
        radial-gradient(circle at 90% 8%, rgba(184,134,11,0.1), transparent 26rem),
        linear-gradient(180deg, var(--champagne), var(--ivory) 46%, var(--beige));
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

.portal-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    z-index: 1050;
    padding: 1.15rem 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    background: rgba(255,252,247,0.92);
    border-left: 1px solid var(--border);
    box-shadow: -18px 0 55px rgba(90,58,15,0.08);
    backdrop-filter: blur(22px);
    transition: transform 0.35s var(--ease);
}

.portal-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text);
    margin-bottom: 1.45rem;
    padding: 0.35rem 0.35rem 1rem;
    border-bottom: 1px solid var(--border);
}
.portal-brand .brand-logo-mark {
    width: 46px;
    height: 46px;
}
.portal-brand > img,
.portal-brand i {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    box-shadow: var(--shadow-gold);
}
.portal-brand > img {
    display: block;
    object-fit: cover;
    padding: 2px;
}
.portal-brand i {
    display: grid;
    place-items: center;
    color: #fff;
}
.portal-brand span {
    display: block;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.3;
}
.portal-club-sidebar .portal-brand em.portal-club-tag,
.portal-club-sidebar .portal-brand > div em {
    display: block;
    margin-top: 0.2rem;
    color: var(--text-muted);
    font-style: normal;
    font-size: 0.66rem;
    letter-spacing: 0.1em;
}

.portal-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    overflow-y: auto;
    padding-inline: 0.1rem;
}
.portal-nav-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 46px;
    padding: 0.68rem 0.85rem;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--text-muted) !important;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.25s;
}
.portal-nav-link i { color: var(--gold-dark); }
.portal-nav-link:hover,
.portal-nav-link.active {
    background: linear-gradient(135deg, #FFF8E7, rgba(255,255,255,0.86));
    border-color: rgba(184,134,11,0.2);
    color: var(--gold-dark) !important;
    transform: translateX(-2px);
}
.nav-count {
    margin-right: auto;
    min-width: 22px;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: var(--gold);
    color: #fff;
    font-size: 0.68rem;
    font-style: normal;
    text-align: center;
}
.portal-sidebar-foot {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.portal-sidebar-foot .small,
.portal-sidebar-foot .text-muted { color: var(--text-muted) !important; }

.portal-shell {
    margin-right: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.82rem clamp(1rem, 3vw, 1.55rem);
    background: rgba(255,252,247,0.82);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
}
.portal-page-title {
    flex: 1;
    margin: 0;
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.portal-topbar-actions { display: flex; align-items: center; gap: 0.35rem; }
.portal-menu-btn,
.portal-icon-btn {
    position: relative;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--gold-dark) !important;
    box-shadow: var(--shadow-sm);
}
.portal-menu-btn { border-radius: 14px; }
.portal-badge {
    position: absolute;
    top: 1px;
    left: 0;
    min-width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--gold);
    color: #fff;
    font-size: 0.64rem;
    border: 2px solid var(--bg-card);
}
.portal-main {
    flex: 1;
    width: min(100%, 1220px);
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 1.6rem);
}
.portal-animate { animation: portalFade 0.5s ease; }
@keyframes portalFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

.portal-club-badge,
.portal-page-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    width: fit-content;
    padding: 0.32rem 0.72rem;
    border: 1px solid rgba(184,134,11,0.24);
    border-radius: 999px;
    background: rgba(255,248,231,0.82);
    color: var(--gold-dark);
    font-size: 0.72rem;
    font-weight: 700;
}
.portal-page-hero,
.portal-club-welcome {
    position: relative;
    overflow: hidden;
    margin-bottom: 1.2rem;
    padding: clamp(1.2rem, 4vw, 2rem);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 12% 0%, rgba(212,175,55,0.24), transparent 18rem),
        linear-gradient(135deg, rgba(255,255,255,0.94), rgba(255,248,237,0.82));
    box-shadow: var(--shadow-sm);
}
.portal-page-hero h2,
.portal-page-hero h1,
.portal-club-welcome h2 {
    margin: 0.55rem 0 0.35rem;
    color: var(--text);
    font-family: var(--font-display), 'Vazirmatn', serif;
    font-size: clamp(1.35rem, 4vw, 2rem);
}
.portal-page-hero p,
.portal-club-welcome p {
    max-width: 64ch;
    margin: 0;
    color: var(--text-muted);
    font-size: 0.94rem;
    line-height: 1.9;
}

.portal-sales-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
    align-items: center;
    gap: 1rem;
}
.portal-sales-copy { min-width: 0; }
.portal-sales-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1rem;
}
.portal-sales-actions .btn {
    min-height: 46px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.portal-sales-price {
    display: grid;
    gap: 0.25rem;
    justify-items: start;
    padding: 1rem;
    border: 1px solid rgba(184,134,11,0.18);
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,0.72);
}
.portal-sales-price span,
.portal-sales-price small {
    color: var(--text-muted);
    font-size: 0.78rem;
}
.portal-sales-price strong {
    color: var(--gold-dark);
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    line-height: 1.35;
}

.portal-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.portal-widget,
.portal-panel,
.portal-product-card,
.notification-card,
.portal-form-card,
.portal-empty-state,
.portal-list-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: var(--text);
}
.portal-widget {
    min-height: 138px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.portal-widget-wide { grid-column: 1 / -1; min-height: auto; }
.widget-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.widget-icon,
.notif-icon,
.portal-card-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 14px;
    color: var(--gold-dark);
    background: rgba(212,175,55,0.12);
}
.widget-icon.gold {
    color: #fff;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
}
.widget-label { color: var(--text-muted); font-size: 0.78rem; }
.widget-value {
    color: var(--gold-dark);
    font-size: clamp(1.25rem, 3vw, 1.55rem);
    font-weight: 800;
    line-height: 1.35;
}
.widget-value small { color: var(--text-muted); font-size: 0.72rem; font-weight: 500; }
.widget-link,
.panel-head a,
.text-gold {
    color: var(--gold-dark) !important;
    font-weight: 700;
}
.portal-progress {
    height: 8px;
    overflow: hidden;
    background: var(--beige);
    border-radius: 999px;
}
.portal-progress .progress-bar {
    background: linear-gradient(90deg, var(--gold-dark), var(--gold-light));
    border-radius: inherit;
}

.portal-quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.portal-qa-btn {
    min-height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.8rem 1rem;
    border: 1px solid rgba(184,134,11,0.2);
    border-radius: var(--radius);
    background: rgba(255,255,255,0.74);
    color: var(--gold-dark) !important;
    font-weight: 700;
}
.portal-qa-btn:hover {
    background: linear-gradient(135deg, #FFF8E7, #fff);
    border-color: rgba(184,134,11,0.34);
}
.portal-qa-primary {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    color: #fff !important;
    box-shadow: var(--shadow-gold);
}
.portal-qa-primary i { color: #fff; }

.portal-panel {
    padding: clamp(1rem, 3vw, 1.25rem);
    height: 100%;
}
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.panel-head h3 { margin: 0; color: var(--text); font-size: 1rem; font-weight: 800; }
.portal-section-kicker {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--gold-dark);
    font-size: 0.72rem;
    font-weight: 800;
}
.portal-club-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    border-radius: var(--radius);
    background: linear-gradient(135deg, #FFF8E7, rgba(255,255,255,0.86));
}
.portal-club-note i { color: var(--gold-dark); font-size: 1.1rem; flex-shrink: 0; margin-top: 0.15rem; }
.portal-club-note p { margin: 0; color: var(--text-muted); font-size: 0.87rem; line-height: 1.8; }
.portal-club-note a { color: var(--gold-dark) !important; font-weight: 800; }

.portal-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 1rem;
}
.portal-product-card {
    overflow: hidden;
    color: inherit !important;
    transition: transform 0.3s var(--ease), box-shadow 0.3s, border-color 0.3s;
}
.portal-product-card:hover {
    transform: translateY(-4px);
    border-color: rgba(184,134,11,0.32);
    box-shadow: var(--shadow-md);
}
.portal-product-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--beige);
}
.portal-product-card .card-body { padding: 0.9rem; }
.portal-product-card h3 { margin: 0 0 0.35rem; color: var(--text); line-height: 1.6; }
.portal-product-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.76rem;
}
.portal-product-price {
    margin-top: 0.55rem;
    color: var(--gold-dark);
    font-weight: 800;
    font-size: 0.9rem;
}
.portal-product-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.8rem;
}
.portal-product-actions .btn { flex: 1; border-radius: 999px; }
.portal-order-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin: -0.35rem 0 1rem;
}
.portal-order-summary > div {
    min-width: 0;
    padding: 0.85rem 0.7rem;
    border: 1px solid rgba(184,134,11,0.18);
    border-radius: 18px;
    background: rgba(255,255,255,0.76);
    text-align: center;
}
.portal-order-summary span {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    white-space: nowrap;
}
.portal-order-summary strong {
    display: block;
    margin-top: 0.18rem;
    color: var(--gold-dark);
    font-size: 1.15rem;
    line-height: 1.35;
}
.portal-order-list {
    display: grid;
    gap: 0.9rem;
}
.portal-order-card {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(184,134,11,0.18);
    border-radius: 22px;
    background: rgba(255,255,255,0.88);
    color: var(--text) !important;
}
.portal-order-card::before {
    content: "";
    position: absolute;
    inset-block: 0;
    right: 0;
    width: 5px;
    background: var(--gold);
}
.portal-order-card-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.portal-order-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 16px;
    background: rgba(212,175,55,0.14);
    color: var(--gold-dark);
}
.portal-order-card h2 {
    margin: 0.22rem 0;
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 900;
    line-height: 1.6;
}
.portal-order-card p,
.portal-order-code {
    color: var(--text-muted);
    font-size: 0.76rem;
    margin: 0;
}
.portal-order-card p i { color: var(--gold-dark); }
.portal-order-meta {
    display: grid;
    gap: 0.42rem;
    justify-items: end;
}
.portal-order-meta strong {
    color: var(--gold-dark);
    white-space: nowrap;
    font-size: 0.92rem;
}
.portal-order-meta em {
    color: var(--text-muted);
    font-size: 0.72rem;
    font-style: normal;
}
.portal-order-hero { padding-bottom: 1.4rem; }
.portal-order-hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1rem;
}
.portal-order-hero-meta strong {
    color: var(--gold-dark);
    font-size: 1.15rem;
}
.portal-order-progress {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.portal-order-step {
    position: relative;
    min-width: 0;
    padding: 0.75rem 0.45rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255,255,255,0.76);
    text-align: center;
}
.portal-order-step span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    margin: 0 auto 0.35rem;
    border-radius: 50%;
    background: rgba(100,116,139,0.12);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 900;
}
.portal-order-step strong {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    white-space: nowrap;
}
.portal-order-step.done {
    border-color: rgba(184,134,11,0.22);
    background: rgba(255,248,231,0.72);
}
.portal-order-step.done span {
    background: var(--gold);
    color: #fff;
}
.portal-order-step.current strong,
.portal-order-step.done strong { color: var(--gold-dark); }
.portal-order-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}
.portal-order-detail-card {
    overflow: hidden;
}
.portal-order-detail-primary {
    border-color: rgba(184,134,11,0.22);
}
.order-detail-product {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    padding: 0.8rem;
    border-radius: 18px;
    background: rgba(255,248,231,0.66);
}
.order-detail-product h2 {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.6;
}
.order-detail-product p {
    margin: 0.2rem 0 0;
    color: var(--text-muted);
    font-size: 0.78rem;
}
.order-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.72rem 0;
    border-bottom: 1px solid var(--border);
}
.order-detail-row span { color: var(--text-muted); font-size: 0.82rem; }
.order-detail-row strong {
    color: var(--text);
    font-size: 0.86rem;
    text-align: left;
    line-height: 1.7;
}
.order-address {
    margin: 0.9rem 0 0;
    padding: 0.9rem;
    border-radius: 18px;
    background: rgba(255,248,231,0.72);
    color: var(--text);
    line-height: 1.9;
}
.order-shipping-box {
    margin-top: 1rem;
    padding: 0.9rem;
    border-radius: 18px;
    background: rgba(34,197,94,0.1);
}
.order-shipping-box span {
    display: block;
    color: var(--text-muted);
    font-size: 0.76rem;
}
.order-shipping-box strong {
    display: block;
    margin-top: 0.2rem;
    color: #15803d;
}
.order-shipping-box p { margin: 0.35rem 0 0; color: var(--text); }
.portal-order-admin-note p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.9;
}
.order-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0.25rem 0.76rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    background: rgba(100,116,139,0.12);
    color: #475569;
    white-space: nowrap;
}
.order-status-pending { background: rgba(245,158,11,0.14); color: #a16207; }
.order-status-confirmed,
.order-status-processing,
.order-status-ready { background: rgba(34,197,94,0.12); color: #15803d; }
.order-status-delivered { background: rgba(59,130,246,0.12); color: #1d4ed8; }
.order-status-cancelled { background: rgba(239,68,68,0.12); color: #b91c1c; }
.pwa-install-prompt,
.notify-prompt {
    position: fixed;
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(86px + env(safe-area-inset-bottom));
    z-index: 1300;
    max-width: 640px;
    margin-inline: auto;
    border: 1px solid rgba(184,134,11,0.22);
    border-radius: 24px;
    background: rgba(255,252,247,0.96);
    color: var(--text);
    box-shadow: 0 24px 70px rgba(90,58,15,0.18);
    backdrop-filter: blur(18px);
}
.pwa-install-prompt {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.85rem;
    padding: 1rem;
    opacity: 0;
    transform: translateY(18px);
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease;
}
.pwa-install-prompt[hidden],
.notify-prompt[hidden] { display: none; }
.pwa-install-prompt.pwa-install-visible,
.notify-prompt.notify-prompt-visible {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.pwa-install-icon,
.notify-prompt-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(212,175,55,0.16);
    color: var(--gold-dark);
}
.pwa-install-copy strong { display: block; color: var(--text); }
.pwa-install-copy span,
.notify-prompt-desc { color: var(--text-muted); font-size: 0.78rem; }
.pwa-install-action {
    border: 0;
    border-radius: 999px;
    min-height: 44px;
    padding: 0.55rem 0.9rem;
    background: var(--gold);
    color: #fff;
    font-weight: 900;
}
.pwa-install-close,
.notify-prompt-close {
    position: absolute;
    top: -10px;
    left: 14px;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--text);
}
.notify-prompt {
    width: min(340px, calc(100vw - 28px));
    padding: 1rem;
    text-align: center;
    opacity: 0;
    transform: translateY(18px);
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease;
}
.notify-prompt-title { font-weight: 900; margin: 0.5rem 0 0.25rem; }
.portal-live-toast {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
    z-index: 1400;
    width: min(560px, calc(100vw - 28px));
    margin-inline: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem;
    border: 1px solid rgba(184,134,11,0.24);
    border-radius: 22px;
    background: rgba(255,252,247,0.97);
    box-shadow: 0 24px 72px rgba(90,58,15,0.2);
    backdrop-filter: blur(18px);
    transform: translateY(-130%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.34s ease, opacity 0.34s ease;
}
.portal-live-toast[hidden] { display: none; }
.portal-live-toast.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}
.portal-live-toast-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    color: #fff;
    box-shadow: var(--shadow-gold);
}
.portal-live-toast-copy {
    min-width: 0;
}
.portal-live-toast-copy strong {
    display: block;
    color: var(--text);
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.portal-live-toast-copy span {
    display: block;
    margin-top: 0.12rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.portal-live-toast-action {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.38rem 0.78rem;
    border-radius: 999px;
    background: rgba(212,175,55,0.16);
    color: var(--gold-dark) !important;
    font-size: 0.78rem;
    font-weight: 900;
}
.portal-live-toast-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(26,22,18,0.06);
    color: var(--text-muted);
}
.portal-sales-showcase { overflow: hidden; }
.portal-sales-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 0.85rem;
}
.portal-sales-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(255,255,255,0.82);
}
.portal-sales-card-media {
    display: block;
    padding: 0.55rem;
    background: linear-gradient(180deg, #FFF8E7, #fff);
}
.portal-sales-card-media img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: calc(var(--radius-lg) - 6px);
}
.portal-sales-card-body {
    display: grid;
    gap: 0.38rem;
    padding: 0.85rem;
}
.portal-sales-card-body span {
    color: var(--text-muted);
    font-size: 0.72rem;
}
.portal-sales-card-body h4 {
    margin: 0;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.65;
}
.portal-sales-card-body h4 a { color: inherit !important; }
.portal-sales-card-body strong {
    color: var(--gold-dark);
    font-size: 0.92rem;
}
.portal-sales-card-body small {
    color: var(--text-muted);
    font-weight: 500;
}
.portal-sales-card-actions {
    display: flex;
    gap: 0.45rem;
    margin-top: 0.25rem;
}
.portal-sales-card-actions .btn:first-child { flex: 1; }
.portal-sales-card-actions .btn:last-child {
    width: 44px;
    flex: 0 0 44px;
    padding-inline: 0;
}
.portal-product-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 0.75rem;
}
.mini-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: inherit !important;
    font-size: 0.78rem;
    font-weight: 600;
}
.mini-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.portal-form-card {
    padding: clamp(1rem, 3vw, 1.35rem);
}
.portal-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.portal-form-grid .full { grid-column: 1 / -1; }
.portal-form-card .form-label,
.portal-form-grid .form-label {
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}
.portal-app .form-control,
.portal-app .form-select,
.portal-auth-screen .form-control,
.portal-auth-screen .form-select {
    min-height: 48px;
    border-color: var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,0.9);
    color: var(--text);
}
.portal-app textarea.form-control { min-height: 112px; }
.portal-app .form-control:focus,
.portal-app .form-select:focus,
.portal-auth-screen .form-control:focus {
    border-color: rgba(184,134,11,0.42);
    box-shadow: 0 0 0 0.22rem rgba(212,175,55,0.12);
}
.portal-pref-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}
.portal-pref-grid .form-check {
    margin: 0;
    padding: 0.85rem 2.4rem 0.85rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(255,252,247,0.74);
}
.portal-pref-grid label { color: var(--text); font-weight: 700; font-size: 0.86rem; }
.portal-pref-grid .form-check-input { margin-right: -1.65rem; border-color: rgba(184,134,11,0.35); }
.portal-pref-grid .form-check-input:checked { background-color: var(--gold); border-color: var(--gold); }

.portal-empty-state {
    padding: clamp(2rem, 6vw, 3.5rem) 1.25rem;
    text-align: center;
}
.portal-empty-state i {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin: 0 auto 0.8rem;
    border-radius: 50%;
    background: rgba(212,175,55,0.12);
    color: var(--gold-dark);
    font-size: 1.6rem;
}
.portal-empty-state h3 { color: var(--text); font-size: 1.05rem; margin: 0 0 0.35rem; }
.portal-empty-state p { color: var(--text-muted); margin: 0 auto 1rem; max-width: 44ch; }

.portal-list { display: grid; gap: 0.75rem; }
.portal-list-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
}
.portal-list-main { display: flex; gap: 0.75rem; align-items: center; min-width: 0; }
.portal-list-main strong { display: block; color: var(--text); }
.portal-list-main span { color: var(--text-muted); font-size: 0.82rem; }
.status-pill {
    font-size: 0.72rem;
    padding: 0.18rem 0.56rem;
    border-radius: 999px;
    background: rgba(212,175,55,0.14);
    color: var(--gold-dark);
    font-weight: 700;
}

.portal-notification-head h2 { color: var(--text); font-weight: 800; }
.portal-notification-head .text-muted,
.notification-card .text-muted,
.portal-panel .text-muted,
.portal-empty-state .text-muted,
.portal-list-card .text-muted { color: var(--text-muted) !important; }
.portal-notification-head .btn { min-height: 42px; border-radius: 999px; }
.notification-filters {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0 0 0.85rem;
    margin-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}
.notification-filter {
    flex: 0 0 auto;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 0.46rem 0.9rem;
    border: 1px solid rgba(184,134,11,0.2);
    border-radius: 999px;
    background: rgba(255,255,255,0.62);
    color: var(--text-muted) !important;
    font-size: 0.8rem;
    font-weight: 700;
}
.notification-filter.active {
    background: #FFF8E7;
    border-color: rgba(184,134,11,0.34);
    color: var(--gold-dark) !important;
}
.notification-list { display: grid; gap: 0.75rem; }
.notification-card {
    padding: 1rem;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.notification-card.unread {
    border-color: rgba(184,134,11,0.36);
    background: linear-gradient(135deg, #FFFCF7, #FFF8E7);
    box-shadow: 0 4px 20px rgba(184,134,11,0.08);
}
.unread-dot {
    width: 8px;
    height: 8px;
    display: inline-block;
    margin-right: 0.4rem;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(212,175,55,0.12);
}

.portal-auth-screen {
    display: grid;
    place-items: center;
    padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
}
.portal-auth-wrap {
    width: min(100%, 470px);
    animation: portalFade 0.5s ease;
}
.portal-auth-home {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.9rem;
    color: var(--gold-dark) !important;
    font-size: 0.82rem;
    font-weight: 700;
}
.portal-club-auth .portal-auth-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--text);
}
.portal-club-auth .portal-auth-brand .brand-logo-mark {
    width: 52px;
    height: 52px;
}
.portal-club-auth .portal-auth-brand > img,
.portal-club-auth .portal-auth-brand i {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
}
.portal-club-auth .portal-auth-brand > img {
    display: block;
    object-fit: cover;
    padding: 2px;
}
.portal-club-auth .portal-auth-brand i {
    display: grid;
    place-items: center;
    color: #fff;
}
.portal-club-auth .portal-auth-brand em {
    display: block;
    color: var(--text-muted);
    font-style: normal;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
}
.portal-auth-card {
    width: 100%;
    padding: clamp(1.1rem, 4vw, 1.6rem);
    border: 1px solid var(--border);
    border-radius: 24px;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 20px 60px rgba(90,58,15,0.12);
    backdrop-filter: blur(20px);
}
.auth-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding: 0.25rem;
    border: 1px solid rgba(184,134,11,0.14);
    border-radius: 999px;
    background: var(--beige);
}
.auth-switch a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border-radius: 999px;
    color: var(--text-muted) !important;
    font-size: 0.86rem;
    font-weight: 700;
}
.auth-switch a.active {
    background: #fff;
    color: var(--gold-dark) !important;
    box-shadow: 0 8px 24px rgba(26,22,18,0.08);
}
.auth-copy { text-align: center; margin-bottom: 1rem; }
.auth-copy h1 {
    margin: 0.45rem 0 0.35rem;
    color: var(--text);
    font-family: var(--font-display), 'Vazirmatn', serif;
    font-size: clamp(1.35rem, 6vw, 1.9rem);
}
.auth-copy p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.8;
}
.auth-alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-radius: 14px;
    font-size: 0.86rem;
}
.auth-field { margin-bottom: 0.85rem; }
.auth-field .form-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
}
.auth-footnote {
    margin: 1rem 0 0;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.84rem;
}
.auth-footnote a { color: var(--gold-dark) !important; font-weight: 800; }
.auth-spinner {
    width: 16px;
    height: 16px;
    display: inline-block;
    margin-left: 0.35rem;
    border: 2px solid rgba(255,255,255,0.5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.portal-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(26,22,18,0.42);
    backdrop-filter: blur(4px);
}

.portal-mobile-bottom-nav {
    position: fixed;
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 1040;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    height: 66px;
    padding: 0.35rem 0.55rem;
    border: 1px solid rgba(184,134,11,0.11);
    border-radius: 28px;
    background: rgba(255,255,255,0.94);
    box-shadow: 0 12px 34px rgba(31,25,18,0.14);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}
.portal-mobile-nav-item {
    min-width: 0;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.08rem;
    color: #2a251f !important;
    font-size: 0.58rem;
    font-weight: 800;
    -webkit-tap-highlight-color: transparent;
}
.portal-mobile-nav-item i { font-size: 1.12rem; line-height: 1; }
.portal-mobile-nav-item.active { color: var(--gold-dark) !important; }
.portal-mobile-nav-primary {
    transform: translateY(-18px);
}
.portal-mobile-nav-primary i {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 22px 22px 28px 28px;
    background: linear-gradient(135deg, #edc879, #c79835);
    color: #fff;
    box-shadow: 0 12px 28px rgba(201,155,53,0.32);
    font-size: 1.55rem !important;
}
.portal-mobile-nav-primary span {
    margin-top: -0.15rem;
    color: #c79835;
}

html[data-theme="showroom-light"] body.portal-app .portal-widget,
html[data-theme="showroom-light"] body.portal-app .portal-panel,
html[data-theme="showroom-light"] body.portal-app .portal-product-card,
html[data-theme="showroom-light"] body.portal-app .notification-card,
html[data-theme="showroom-light"] body.portal-app .portal-form-card,
html[data-theme="showroom-light"] body.portal-app .portal-empty-state,
html[data-theme="showroom-light"] body.portal-app .portal-list-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-sm) !important;
    color: var(--text) !important;
}
html[data-theme="showroom-light"] body.portal-auth-screen .portal-auth-wrap {
    min-height: auto !important;
    background: transparent !important;
}
html[data-theme="showroom-light"] body.portal-auth-screen .portal-auth-card {
    border-radius: 24px !important;
    box-shadow: 0 20px 60px rgba(90,58,15,0.12) !important;
}
html[data-theme="showroom-light"] body.portal-app .notification-card.unread {
    background: linear-gradient(135deg, #FFFCF7, #FFF8E7) !important;
}

@media (max-width: 991px) {
    .portal-sidebar { transform: translateX(100%); }
    .portal-sidebar.open { transform: none; }
    .portal-sidebar-backdrop.show { display: block; }
    .portal-shell { margin-right: 0; }
    .portal-app {
        padding-bottom: calc(86px + env(safe-area-inset-bottom));
    }
    .portal-main {
        padding-bottom: 1.25rem;
    }
}
@media (max-width: 767px) {
    .portal-sales-hero {
        grid-template-columns: 1fr;
    }
    .portal-sales-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .portal-sales-price {
        grid-template-columns: 1fr auto;
        align-items: end;
    }
    .portal-sales-price span,
    .portal-sales-price small {
        grid-column: 1 / -1;
    }
    .portal-sales-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }
    .portal-form-grid,
    .portal-pref-grid { grid-template-columns: 1fr; }
    .portal-list-card { align-items: flex-start; flex-direction: column; }
    .portal-list-card form { width: 100%; }
    .portal-list-card .btn { width: 100%; }
    .portal-order-card {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    .portal-order-meta {
        width: 100%;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        justify-items: start;
    }
    .portal-order-meta strong {
        justify-self: center;
    }
    .portal-order-meta em {
        justify-self: end;
    }
    .portal-order-detail-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 430px) {
    .portal-main { padding: 1rem; }
    .portal-topbar { padding-inline: 0.9rem; }
    .portal-page-title {
        font-size: 0.92rem;
        text-align: center;
    }
    .portal-sales-hero,
    .portal-club-welcome {
        padding: 1.05rem;
        border-radius: 22px;
    }
    .portal-sales-hero h2,
    .portal-club-welcome h2 {
        font-size: 1.45rem;
    }
    .portal-sales-hero p,
    .portal-club-welcome p {
        font-size: 0.88rem;
    }
    .portal-sales-actions .btn {
        min-height: 48px;
        padding-inline: 0.65rem;
        font-size: 0.78rem;
    }
    .portal-sales-price {
        padding: 0.85rem;
    }
    .portal-widgets { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
    .portal-widget-wide { grid-column: span 2; }
    .portal-widget { min-height: 128px; padding: 0.9rem; }
    .portal-quick-actions {
        grid-template-columns: 1fr 1fr;
    }
    .portal-qa-primary {
        grid-column: 1 / -1;
    }
    .portal-sales-card-media { padding: 0.42rem; }
    .portal-sales-card-body { padding: 0.72rem; }
    .portal-sales-card-body h4 { font-size: 0.8rem; }
    .portal-sales-card-actions {
        display: grid;
        grid-template-columns: 1fr 44px;
    }
    .portal-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
    .portal-auth-screen { place-items: start center; }
    .portal-auth-wrap { padding-top: 0.25rem; }
    .portal-auth-card { border-radius: 20px; }
    .auth-switch a { min-height: 44px; font-size: 0.82rem; }
    .notification-card { padding: 0.85rem; border-radius: 16px; }
    .notification-card .d-flex { min-width: 0; }
    .notif-icon { width: 38px; height: 38px; border-radius: 12px; }
    .notification-filter { min-height: 44px; }
    .portal-live-toast {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 0.58rem;
        padding: 0.72rem;
        border-radius: 18px;
    }
    .portal-live-toast-icon {
        width: 40px;
        height: 40px;
        border-radius: 14px;
    }
    .portal-live-toast-action {
        grid-column: 2 / 4;
        width: 100%;
    }
    .portal-live-toast-close {
        position: absolute;
        top: -8px;
        left: 10px;
        background: #fff;
    }
    .portal-order-summary {
        gap: 0.5rem;
    }
    .portal-order-summary > div {
        padding: 0.68rem 0.45rem;
        border-radius: 16px;
    }
    .portal-order-summary span {
        font-size: 0.62rem;
    }
    .portal-order-summary strong {
        font-size: 1rem;
    }
    .portal-order-card {
        padding: 0.9rem;
        border-radius: 20px;
    }
    .portal-order-icon {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }
    .portal-order-card h2 {
        font-size: 0.9rem;
    }
    .portal-order-meta {
        grid-template-columns: 1fr 1fr;
        gap: 0.55rem;
    }
    .portal-order-meta .order-status {
        justify-self: start;
    }
    .portal-order-meta strong {
        justify-self: end;
        font-size: 0.86rem;
    }
    .portal-order-meta em {
        grid-column: 1 / -1;
        justify-self: stretch;
        min-height: 38px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        background: rgba(212,175,55,0.12);
        color: var(--gold-dark);
        font-weight: 900;
    }
    .portal-order-progress {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .portal-order-step {
        padding: 0.65rem 0.4rem;
    }
    .portal-order-step strong {
        font-size: 0.68rem;
    }
    .order-detail-product {
        align-items: flex-start;
    }
    .order-detail-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.18rem;
    }
    .order-detail-row strong {
        text-align: right;
    }
    .portal-order-hero-meta {
        display: grid;
        grid-template-columns: 1fr;
    }
    .portal-order-hero-meta strong {
        font-size: 1rem;
    }
}
@media (max-width: 360px) {
    .portal-auth-screen { padding-inline: 0.75rem; }
    .portal-auth-card,
    .portal-panel,
    .portal-form-card { padding: 1rem; }
    .auth-copy p { font-size: 0.82rem; }
    .portal-widgets { gap: 0.65rem; }
    .notification-card { font-size: 0.88rem; }
    .portal-order-summary {
        grid-template-columns: 1fr;
    }
    .portal-order-summary > div {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: right;
    }
    .portal-order-card-main {
        align-items: flex-start;
    }
    .portal-order-meta {
        grid-template-columns: 1fr;
    }
    .portal-order-meta strong,
    .portal-order-meta .order-status {
        justify-self: stretch;
        justify-content: center;
        text-align: center;
    }
}
