/* ========================
   Vazirmatn FD Font
   ======================== */
@font-face {
    font-family: 'Vazirmatn';
    font-weight: 100;
    font-display: swap;
    src: url('/fonts/vazirmatn/Vazirmatn-FD-Thin.woff2') format('woff2');
}

@font-face {
    font-family: 'Vazirmatn';
    font-weight: 200;
    font-display: swap;
    src: url('/fonts/vazirmatn/Vazirmatn-FD-ExtraLight.woff2') format('woff2');
}

@font-face {
    font-family: 'Vazirmatn';
    font-weight: 300;
    font-display: swap;
    src: url('/fonts/vazirmatn/Vazirmatn-FD-Light.woff2') format('woff2');
}

@font-face {
    font-family: 'Vazirmatn';
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/vazirmatn/Vazirmatn-FD-Regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Vazirmatn';
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/vazirmatn/Vazirmatn-FD-Medium.woff2') format('woff2');
}

@font-face {
    font-family: 'Vazirmatn';
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/vazirmatn/Vazirmatn-FD-SemiBold.woff2') format('woff2');
}

@font-face {
    font-family: 'Vazirmatn';
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/vazirmatn/Vazirmatn-FD-Bold.woff2') format('woff2');
}

@font-face {
    font-family: 'Vazirmatn';
    font-weight: 800;
    font-display: swap;
    src: url('/fonts/vazirmatn/Vazirmatn-FD-ExtraBold.woff2') format('woff2');
}

@font-face {
    font-family: 'Vazirmatn';
    font-weight: 900;
    font-display: swap;
    src: url('/fonts/vazirmatn/Vazirmatn-FD-Black.woff2') format('woff2');
}

/* ========================
   Default theme tokens (light) — prevents flash before MudBlazor JS hydrates
   ======================== */
:root {
    --mud-palette-background:    #FFFFFF;
    --mud-palette-surface:       #FFFFFF;
    --mud-palette-divider:       #E4E4E7;
    --mud-palette-text-primary:  #18181B;
    --mud-palette-text-secondary:#52525B;
    --mud-palette-text-disabled: #A1A1AA;
    --mud-palette-lines-inputs:  #D4D4D8;
    --mud-palette-primary:       #5E6AD2;
    --mud-palette-error:         #EF4444;
}

/* ========================
   Global Base
   ======================== */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html, body {
    font-family: 'Vazirmatn', sans-serif !important;
    direction: rtl;
    text-align: right;
    margin: 0;
    padding: 0;
}

/* MudBlazor Font Override */
.mud-typography,
.mud-input,
.mud-button,
.mud-table,
.mud-alert,
.mud-chip,
.mud-nav-link,
.mud-list-item {
    font-family: 'Vazirmatn', sans-serif !important;
}

/* RTL fixes for Auth pages */
.form-floating > label {
    right: 0;
    left: auto;
}

.form-floating > .form-control,
.form-floating > .form-select {
    padding-right: 0.75rem;
    text-align: right;
}

/* Blazor Error UI */
.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    text-align: center;
}

.blazor-error-boundary::after {
    content: "خطایی رخ داده است.";
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #5E6AD2;
}

/* ════════════════════════════════════════════════
   WORKER LAYOUT — Public seller panel chrome
   ════════════════════════════════════════════════ */
.worker-layout {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--mud-palette-background, #FFFFFF);
    display: flex;
    flex-direction: column;
}

.worker-appbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--mud-palette-surface, #FFFFFF);
    border-bottom: 1px solid var(--mud-palette-divider, #E4E4E7);
    backdrop-filter: blur(8px);
    direction: rtl;
}

.worker-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.worker-logo {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    display: block;
}

.worker-brand-name {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary, #18181B);
    letter-spacing: 0.01em;
}

.worker-spacer {
    flex: 1;
}

.worker-logout-form {
    display: inline-flex;
    margin: 0;
}

.worker-main {
    flex: 1;
}

/* ════════════════════════════════════════════════
   SELLER PAGE — Worker.razor
   Search-first vendor lookup tool
   ════════════════════════════════════════════════ */

.seller-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px 32px;
    direction: rtl;
}

/* ── Sticky search zone ─────────────────────── */
.seller-search-zone {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 16px 0 12px;
    margin-bottom: 16px;
    background: var(--mud-palette-background, #FFFFFF);
    background-image: linear-gradient(to bottom, var(--mud-palette-background, #FFFFFF) 85%, transparent);
}

.seller-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--mud-palette-surface, #FFFFFF);
    border: 1px solid var(--mud-palette-lines-inputs, #D4D4D8);
    border-radius: 14px;
    padding: 0 14px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
    cursor: text;
}

.seller-search:focus-within {
    border-color: #5E6AD2;
    box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.14);
}

.seller-search-icon {
    width: 20px;
    height: 20px;
    color: var(--mud-palette-text-secondary, #52525B);
    flex-shrink: 0;
}

.seller-search-input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--mud-palette-text-primary, #18181B);
    padding: 16px 0;
    direction: rtl;
    min-width: 0;
}

.seller-search-input::placeholder {
    color: var(--mud-palette-text-disabled, #A1A1AA);
    font-weight: 400;
}

.seller-search-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--mud-palette-text-secondary, #52525B);
    border-radius: 8px;
    flex-shrink: 0;
    padding: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.seller-search-clear svg {
    width: 16px;
    height: 16px;
}

.seller-search-clear:hover {
    background: var(--mud-palette-divider, #E4E4E7);
    color: var(--mud-palette-text-primary, #18181B);
}

/* "/" keyboard-shortcut hint — looks like a keyboard cap */
.seller-search-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border: 1px solid var(--md-sys-color-outline-variant, #D4D4D8);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--md-sys-color-surface-container, #F2F0F5);
    color: var(--md-sys-color-on-surface-variant, #687076);
    font-family: ui-monospace, 'JetBrains Mono', 'SF Mono', Consolas, monospace;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
    user-select: none;
    flex-shrink: 0;
    margin-left: 6px;
    cursor: default;
}
html[data-theme='dark'] .seller-search-kbd {
    background: var(--md-sys-color-surface-container-high);
    border-color: var(--md-sys-color-outline);
    color: var(--md-sys-color-on-surface-variant);
}

/* ── Meta row (count + chips) ───────────────── */
.seller-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
    direction: rtl;
}

.seller-meta-count {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary, #52525B);
    padding: 4px 0;
}

.seller-meta-spacer {
    flex: 1;
}

.seller-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid var(--mud-palette-divider, #E4E4E7);
    background: var(--mud-palette-surface, #FFFFFF);
    color: var(--mud-palette-text-secondary, #52525B);
    line-height: 1.4;
    white-space: nowrap;
}

.seller-chip svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.seller-chip--discount {
    color: #15803D;
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.25);
}

.seller-chip--rate {
    font-variant-numeric: tabular-nums;
}

/* ── Empty / hint states ────────────────────── */
.seller-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px;
    text-align: center;
}

.seller-hint-icon,
.seller-empty-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(94, 106, 210, 0.08);
    color: #5E6AD2;
    margin-bottom: 18px;
}

.seller-empty-icon {
    background: var(--mud-palette-divider, #E4E4E7);
    color: var(--mud-palette-text-secondary, #52525B);
}

.seller-hint-icon svg,
.seller-empty-icon svg {
    width: 28px;
    height: 28px;
}

.seller-hint-title {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary, #18181B);
    margin: 0 0 8px;
    line-height: 1.4;
}

.seller-hint-text {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--mud-palette-text-secondary, #52525B);
    margin: 0;
    max-width: 320px;
}

/* ── Results grid ───────────────────────────── */
.seller-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 600px) {
    .seller-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
@media (min-width: 900px) {
    .seller-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1280px) {
    .seller-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ── Product card ───────────────────────────── */
.seller-card {
    background: var(--mud-palette-surface, #FFFFFF);
    border: 1px solid var(--mud-palette-divider, #E4E4E7);
    border-radius: 14px;
    padding: 16px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

@media (hover: hover) {
    .seller-card:hover {
        border-color: rgba(94, 106, 210, 0.4);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
        transform: translateY(-1px);
    }
}

.seller-card-head {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--mud-palette-divider, #E4E4E7);
}

.seller-card-fa {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary, #18181B);
    margin: 0 0 4px;
    line-height: 1.45;
    letter-spacing: 0.005em;
}

.seller-card-en {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.82rem;
    font-weight: 400;
    color: var(--mud-palette-text-secondary, #52525B);
    margin: 0;
    direction: ltr;
    text-align: left;
    text-transform: capitalize;
    letter-spacing: 0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Hero price block (single price prominent) ── */
.seller-card-price-block {
    text-align: center;
    padding: 14px 4px 6px;
    min-height: 78px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.seller-strike-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    direction: rtl;
}

.seller-strike-num {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--mud-palette-text-disabled, #A1A1AA);
    text-decoration: line-through;
    text-decoration-thickness: 1.5px;
    text-decoration-color: rgba(239, 68, 68, 0.6);
    direction: ltr;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.005em;
}

.seller-discount-badge {
    display: inline-flex;
    align-items: center;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: #DC2626;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 2px 9px;
    border-radius: 999px;
    line-height: 1.5;
    white-space: nowrap;
}

.seller-final-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 7px;
    direction: rtl;
}

.seller-final-num {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: #5E6AD2;
    direction: ltr;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.seller-final-unit {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary, #52525B);
}

/* ── Floor (max-discount) hint — no strike, just informational ── */
.seller-floor-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 6px auto 0;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.10);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: #15803D;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.72rem;
    line-height: 1.5;
    direction: rtl;
}
.mud-dark-theme .seller-floor-row,
html[data-theme='dark'] .seller-floor-row {
    background: rgba(74, 222, 128, 0.14);
    border-color: rgba(74, 222, 128, 0.30);
    color: #4ADE80;
}
.seller-floor-icon { width: 12px; height: 12px; flex-shrink: 0; }
.seller-floor-label { font-weight: 500; }
.seller-floor-num {
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    direction: ltr;
}
.seller-floor-unit { opacity: 0.85; }

/* ── Actions row at the bottom of each product card ── */
.seller-card {
    display: flex;
    flex-direction: column;
}
.seller-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.seller-card-sell {
    flex: 1;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 10px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    -webkit-appearance: none;
    appearance: none;
    background: #5E6AD2;
    color: #FFFFFF;
    border: 0;
}
.seller-card-sell svg { width: 15px; height: 15px; }
.seller-card-sell:hover  { background: #4F5BBB; }
.seller-card-sell:active { transform: scale(0.98); }
html[data-theme='dark'] .seller-card-sell        { background: #5373E7; color: #FFFFFF; }
html[data-theme='dark'] .seller-card-sell:hover  { background: #6E83EF; }

.seller-more { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 20px 0 8px; }
.seller-more-btn {
    height: 42px;
    padding: 0 28px;
    border-radius: 10px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
    background: transparent;
    color: #5E6AD2;
    border: 1px solid #5E6AD2;
}
.seller-more-btn:hover  { background: rgba(94, 106, 210, 0.08); }
.seller-more-btn:active { transform: scale(0.98); }
html[data-theme='dark'] .seller-more-btn        { color: #8FA1F5; border-color: #5373E7; }
html[data-theme='dark'] .seller-more-btn:hover  { background: rgba(83, 115, 231, 0.12); }

/* ── Mobile tweaks ──────────────────────────── */
@media (max-width: 599px) {
    .seller-page { padding: 0 12px 24px; }
    .seller-search-zone { padding: 12px 0 10px; margin-bottom: 12px; }
    .seller-search-input { font-size: 1rem; padding: 14px 0; }
    .seller-meta-count { font-size: 0.78rem; }
    .seller-chip { font-size: 0.72rem; padding: 4px 9px; }
    .seller-card { padding: 14px; border-radius: 12px; }
    .seller-card-fa { font-size: 0.98rem; }
    .seller-card-en { font-size: 0.78rem; }
    .seller-final-num { font-size: 1.5rem; }
    .seller-final-unit { font-size: 0.8rem; }
    .seller-strike-num { font-size: 0.85rem; }
    .seller-discount-badge { font-size: 0.66rem; padding: 2px 8px; }
    .seller-state { padding: 48px 20px; }
}

/* ════════════════════════════════════════════════
   APP BAR BRAND — Logo + site name
   ════════════════════════════════════════════════ */
/* ════════════════════════════════════════════════
   TOP APP BAR — brand · search pill · actions · user
   (Color Admin Material layout, mirrored for RTL)
   ════════════════════════════════════════════════ */
.mud-appbar.app-topbar {
    background: var(--dash-card, #FFFFFF) !important;
    border-bottom: 1px solid var(--dash-card-border, rgba(15, 23, 42, 0.06));
    color: var(--mud-palette-text-primary);
}
.app-topbar .mud-toolbar {
    gap: 12px;
    padding-inline: 16px 20px;
}

.appbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-inline-start: 4px;
    text-decoration: none;
    color: inherit;
}
.appbar-brand-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    flex-shrink: 0;
    display: block;
}
.appbar-brand-name {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--mud-palette-text-primary);
    white-space: nowrap;
}

/* Centre column holds the search pill; it absorbs the free space. */
.appbar-center {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
    padding-inline: 24px;
}
.appbar-search {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 720px;
    height: 48px;
    padding: 0 20px;
    border-radius: 999px;
    background: var(--dash-pill-bg, #EEF1F4);
    border: 1px solid transparent;
    cursor: text;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.appbar-search:focus-within {
    background: var(--dash-card, #FFFFFF);
    border-color: var(--dash-accent, #1E88E5);
    box-shadow: 0 0 0 3px var(--dash-accent-soft, rgba(30, 136, 229, 0.12));
}
.appbar-search-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: var(--mud-palette-text-secondary);
}
.appbar-search-input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.98rem;
    color: var(--mud-palette-text-primary);
    direction: rtl;
}
.appbar-search-input::placeholder { color: var(--mud-palette-text-secondary); opacity: 0.8; }
.appbar-search-kbd {
    flex-shrink: 0;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    display: inline-grid;
    place-items: center;
    border-radius: 6px;
    border: 1px solid var(--mud-palette-divider);
    background: var(--dash-card, #FFFFFF);
    font-family: ui-monospace, monospace;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}
.appbar-search-clear {
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--mud-palette-text-secondary);
    cursor: pointer;
}
.appbar-search-clear:hover { background: rgba(127, 127, 127, 0.14); }
.appbar-search-clear svg { width: 16px; height: 16px; }

.appbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Signed-in user chip */
.appbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 52px;
    padding: 0 6px 0 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: background 0.15s ease;
}
.appbar-user:hover { background: var(--dash-pill-bg, #EEF1F4); }
.appbar-user-avatar {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--dash-ink, #2B3035), var(--dash-ink-2, #1F2327));
    color: #FFFFFF;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
}
.appbar-user-avatar--lg { width: 48px; height: 48px; font-size: 1.2rem; }
.appbar-user-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.3;
    min-width: 0;
    text-align: start;
}
.appbar-user-name {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--mud-palette-text-primary);
    white-space: nowrap;
}
.appbar-user-role {
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.76rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}
.appbar-user-sep { margin: 0 4px; opacity: 0.6; }
.appbar-user-caret { width: 18px; height: 18px; color: var(--mud-palette-text-secondary); }

.appbar-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--mud-palette-divider);
    direction: rtl;
}
.appbar-user-logout { margin: 0; padding: 6px; }
.appbar-user-logout button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--md-sys-color-error, #DC2626);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    direction: rtl;
}
.appbar-user-logout button:hover { background: rgba(220, 38, 38, 0.08); }

@media (max-width: 1023px) {
    .appbar-user-text, .appbar-user-caret { display: none; }
    .appbar-user { padding: 0 4px; }
    .appbar-center { padding-inline: 8px; }
}
@media (max-width: 599px) {
    /* Phones: the pill is replaced by the in-page search box. */
    .appbar-center { visibility: hidden; padding: 0; }
    .appbar-brand-name { font-size: 1rem; }
}
/* The panel's own input only appears where the header pill is hidden. */
@media (min-width: 600px) {
    .seller-search.seller-search--mobile-only { display: none; }
}

/* ════════════════════════════════════════════════
   APP DRAWER — Custom responsive sidebar
   Right-fixed on desktop, slide-in overlay on mobile
   Starts BELOW the fixed top app bar
   ════════════════════════════════════════════════ */

.app-drawer {
    position: fixed;
    top: 64px;            /* below MudAppBar (64px desktop) */
    right: 0;
    bottom: 0;
    width: 240px;
    background: var(--mud-palette-surface, #141414);
    border-left: 1px solid var(--mud-palette-divider, rgba(255,255,255,0.08));
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1100;
    direction: rtl;
}

.app-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1099;
    animation: drawer-backdrop-in 0.18s ease;
}

@keyframes drawer-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ─── Desktop (≥960px) ───────────────────────────
   Drawer is permanent, hamburger hidden, content offset */
@media (min-width: 960px) {
    .app-drawer {
        transform: translateX(0) !important;
    }
    .app-drawer-backdrop {
        display: none !important;
    }
    .drawer-toggle-btn {
        display: none !important;
    }
    .mud-main-content {
        margin-right: 240px !important;
        margin-left: 0 !important;
    }
}

/* ─── Mobile (<960px) ────────────────────────────
   Drawer hidden by default, slides in from right when open */
@media (max-width: 959px) {
    .app-drawer {
        transform: translateX(100%);
        transition: transform 0.225s ease;
        z-index: 1300;
        box-shadow: -4px 0 16px rgba(0, 0, 0, 0.3);
    }
    .app-drawer.is-open {
        transform: translateX(0);
    }
    .app-drawer-backdrop {
        z-index: 1299;
    }
    .mud-main-content {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }
}

/* Mobile (<600px): smaller appbar height */
@media (max-width: 599px) {
    .app-drawer {
        top: 56px;
    }
}

/* Dialog overrides moved to /css/design-system.css (.ds-dialog-*, .ds-btn, .ds-confirm). */

/* ─────────────────────────────────────────────────────────────
   Gender pill group — shared by QuickMultiSaleDialog and the
   Customers admin page. Keep these global (not scoped) so the
   same UI works in dialogs and on stand-alone forms.
   ──────────────────────────────────────────────────────────── */
.qm-gender-group {
    display: inline-flex;
    width: 100%;
    border-radius: var(--md-sys-shape-corner-extra-small);
    overflow: hidden;
    border: 1px solid var(--md-sys-color-outline);
    background: var(--md-sys-color-surface-container-lowest);
}
.qm-gender {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 4px 8px;
    background: transparent;
    border: 0;
    border-inline-start: 1px solid var(--md-sys-color-outline-variant);
    color: var(--md-sys-color-on-surface-variant);
    font-family: var(--md-sys-typescale-plain-font);
    font-size: var(--text-sm);
    font-weight: var(--md-sys-typescale-weight-medium);
    cursor: pointer;
    transition: background-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}
.qm-gender:first-child { border-inline-start: 0; }
.qm-gender:hover { background: color-mix(in srgb, var(--md-sys-color-on-surface) 6%, transparent); }
.qm-gender-check {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}
.qm-gender--active {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    font-weight: var(--md-sys-typescale-weight-semibold);
}
.qm-gender--male {
    background: color-mix(in srgb, var(--payment-pos-container) 70%, var(--md-sys-color-secondary-container));
    color: var(--payment-pos-on-container);
}
.qm-gender--female {
    background: #FBD8E6;
    color: #5C1135;
}
html[data-theme='dark'] .qm-gender--female {
    background: #5C1135;
    color: #FBD8E6;
}

/* ─────────────────────────────────────────────────────────────
   Shared table-cell helpers for admin lists (Branches, Warehouses,
   Suppliers, Customers) once they were converted to ds-table style.
   ──────────────────────────────────────────────────────────── */
.br-cell-name, .wh-cell-name, .sup-cell-name {
    display: flex; align-items: center; gap: 8px; min-width: 0;
}
.br-cell-icon, .wh-cell-icon, .sup-cell-icon {
    flex: 0 0 auto;
    font-size: 1.1rem !important;
    color: var(--md-sys-color-on-surface-variant);
}
.br-cell-name-text, .wh-cell-name-text, .sup-cell-name-text {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--md-sys-color-on-surface);
    font-weight: var(--md-sys-typescale-weight-medium);
}
.br-row--inactive, .wh-row--inactive, .sup-row--inactive { opacity: 0.65; }
.br-row:hover, .wh-row:hover, .sup-row:hover {
    background: color-mix(in srgb, var(--md-sys-color-on-surface) 6%, transparent) !important;
}
.br-skel-row, .wh-skel-row, .sup-skel-row, .cust-skel-row {
    display: flex; gap: var(--space-4);
    padding: 14px 16px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
}
.phone-cell {
    font-variant-numeric: tabular-nums;
    direction: ltr;
    text-align: right;
}
.email-cell { direction: ltr; text-align: right; }
.code-cell {
    font-family: var(--md-sys-typescale-plain-font);
    color: var(--md-sys-color-on-surface-variant);
    font-variant-numeric: tabular-nums;
}
.addr-cell, .notes-cell {
    color: var(--md-sys-color-on-surface-variant);
    max-width: 260px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ds-pagination-row {
    padding: 15px 5px;
}

.mud-pagination-item > p.mud-typography {
    line-height: 2.5;
}
/* ── User dropdown (custom, no MudMenu) ── */
.appbar-user-wrap { position: relative; }
.appbar-user.is-open { background: var(--dash-pill-bg, #EEF1F4); }
.appbar-user.is-open .appbar-user-caret { transform: rotate(180deg); }
.appbar-user-caret { transition: transform 0.15s ease; font-size: 1.3rem !important; }
.appbar-menu-scrim { position: fixed; inset: 0; z-index: 1300; }
.appbar-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 1301;
    width: 280px;
    max-width: calc(100vw - 24px);
    overflow: hidden;
    border-radius: 16px;
    border: 1px solid var(--md-sys-color-outline-variant);
    background: var(--md-sys-color-surface-container-low);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
    direction: rtl;
    animation: appbar-menu-in 0.14s ease-out;
}
@keyframes appbar-menu-in { from { opacity: 0; transform: translateY(-6px); } }
.appbar-menu-list { display: flex; flex-direction: column; padding: 6px; }
.appbar-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--md-sys-color-on-surface);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.92rem;
    text-decoration: none;
    text-align: start;
    cursor: pointer;
}
.appbar-menu-item .mud-icon-root { font-size: 1.25rem; color: var(--md-sys-color-on-surface-variant); }
.appbar-menu-item:hover { background: var(--md-sys-color-surface-container); }
.appbar-menu .appbar-user-logout { border-top: 1px solid var(--md-sys-color-outline-variant); }
@media (max-width: 599px) {
    .appbar-menu { position: fixed; top: 60px; left: 12px; }
}

/* User menu: buttons rendered exactly like the link items; theme toggle row */
.appbar-menu button.appbar-menu-item {
    width: 100%;
    margin: 0;
    justify-content: flex-start;
    line-height: inherit;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    -webkit-appearance: none;
    appearance: none;
}
.appbar-menu-prefs { border-top: 1px solid var(--md-sys-color-outline-variant); }
.appbar-menu-label { flex: 1; text-align: start; }
.appbar-switch {
    position: relative;
    flex-shrink: 0;
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: var(--md-sys-color-outline-variant);
    transition: background 0.15s ease;
}
.appbar-switch > span {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: right 0.15s ease;
}
.appbar-switch.is-on { background: var(--md-sys-color-primary); }
.appbar-switch.is-on > span { right: 18px; }
