:root {
    --color-primary: #E8573A;
    --color-primary-hover: #D04A30;
    --color-primary-light: #FAEAE4;
    --color-primary-surface: #FFF5F1;
    --color-primary-glow: rgba(232, 87, 58, 0.12);
    --color-primary-shadow: rgba(232, 87, 58, 0.2);
    --color-danger: #DC2626;
    --color-success: #16A34A;
    --color-text: #2D1B14;
    --color-text-muted: #8C6D62;
    --color-bg: #FDF8F6;
    --color-bg-gradient: linear-gradient(165deg, #FDF8F6 0%, #FAEAE4 100%);
    --color-surface: #FFFFFF;
    --color-border: #E8D5CE;
    --color-input-bg: #FFFFFF;
    --radius: 1rem;
    --radius-sm: 0.5rem;
    --radius-otp: 0.75rem;
    --font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    --shadow-card: 0 2px 8px rgba(232, 87, 58, 0.05), 0 8px 24px rgba(232, 87, 58, 0.03);
    --shadow-btn: 0 2px 6px rgba(232, 87, 58, 0.2);
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --color-primary: #E8573A;
    --color-primary-hover: #F06A50;
    --color-primary-light: #3D2018;
    --color-primary-surface: #2A1610;
    --color-primary-glow: rgba(232, 87, 58, 0.2);
    --color-primary-shadow: rgba(232, 87, 58, 0.35);
    --color-danger: #F87171;
    --color-success: #4ADE80;
    --color-text: #F5EBE6;
    --color-text-muted: #A68E84;
    --color-bg: #1A100C;
    --color-bg-gradient: linear-gradient(165deg, #1A100C 0%, #261812 100%);
    --color-surface: #231714;
    --color-border: #3D2A22;
    --color-input-bg: #1A100C;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-btn: 0 2px 8px rgba(232, 87, 58, 0.35);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.7;
    min-height: 100dvh;
}

/* ========== Auth pages ========== */
.auth-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 1.5rem;
    background: var(--color-bg-gradient);
}

.auth-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 2.25rem 2rem;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--color-border);
}

.auth-card h1 {
    font-size: 1.375rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.25rem;
    color: var(--color-text);
}

.auth-card .subtitle {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    margin-bottom: 1.75rem;
}

/* ========== Logo ========== */
.logo {
    text-align: center;
    margin-bottom: 1.25rem;
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.logo-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.logo-text {
    display: block;
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--color-primary);
}

/* ========== Form elements ========== */
.form-group {
    margin-bottom: 1.125rem;
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--color-text);
}

.form-input {
    width: 100%;
    padding: 0.6875rem 0.875rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.9375rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--color-input-bg);
    color: var(--color-text);
    direction: ltr;
    text-align: right;
}

.form-input::placeholder {
    color: var(--color-text-muted);
    opacity: 0.6;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

/* ========== OTP ========== */
.otp-container {
    display: flex;
    gap: 0.75rem;
    direction: ltr;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.otp-digit {
    width: 3.25rem;
    height: 3.75rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-otp);
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    font-family: var(--font-family);
    color: var(--color-text);
    background: var(--color-input-bg);
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    caret-color: var(--color-primary);
}

.otp-digit:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-primary-surface);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
    box-shadow: var(--shadow-btn);
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--color-primary-hover);
    box-shadow: 0 4px 12px var(--color-primary-shadow);
}

.btn-primary:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-ghost {
    background: transparent;
    color: var(--color-primary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--color-primary-light);
}

/* ========== Form extras ========== */
.link-row {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 1.25rem;
}

.text-link {
    font-size: 0.8125rem;
    color: var(--color-primary);
    text-decoration: none;
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font-family);
    font-weight: 500;
    transition: opacity 0.15s;
}

.text-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* ========== Alerts ========== */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-error {
    background: #FEF2F2;
    color: var(--color-danger);
    border: 1px solid #FECACA;
}

.alert-success {
    background: #F0FDF4;
    color: var(--color-success);
    border: 1px solid #BBF7D0;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .alert-error {
        background: #3B1515;
        border-color: #5C2020;
    }
    html:not([data-theme="light"]) .alert-success {
        background: #0F2A18;
        border-color: #1A4028;
    }
}

html[data-theme="dark"] .alert-error {
    background: #3B1515;
    border-color: #5C2020;
}
html[data-theme="dark"] .alert-success {
    background: #0F2A18;
    border-color: #1A4028;
}

/* ========== Toast ========== */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 1rem;
    right: 1rem;
    z-index: 1000;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: toast-in 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.toast-error {
    background: #FEF2F2;
    color: var(--color-danger);
    border: 1px solid #FECACA;
}

.toast-success {
    background: #F0FDF4;
    color: var(--color-success);
    border: 1px solid #BBF7D0;
}

.toast-dismiss {
    margin-right: auto;
    background: none;
    border: none;
    color: inherit;
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.6;
}

.toast-dismiss:hover {
    opacity: 1;
}

@keyframes toast-in {
    from { transform: translateY(1rem); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .toast-error {
        background: #3B1515;
        border-color: #5C2020;
    }
    html:not([data-theme="light"]) .toast-success {
        background: #0F2A18;
        border-color: #1A4028;
    }
}

html[data-theme="dark"] .toast-error {
    background: #3B1515;
    border-color: #5C2020;
}
html[data-theme="dark"] .toast-success {
    background: #0F2A18;
    border-color: #1A4028;
}

/* ========== Timer ========== */
.timer {
    text-align: center;
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-top: 0.875rem;
}

/* ========== Authenticated shell ========== */
.app-shell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
}

.app-header {
    background: var(--color-primary);
    color: #fff;
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px var(--color-primary-shadow);
}

.app-header h1 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
}

.header-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    border-radius: 50%;
}

.header-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: white;
}

.app-content {
    flex: 1;
    padding: 1.25rem;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* ========== Branch list ========== */
.branch-list {
    list-style: none;
}

.branch-item {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    margin-bottom: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.branch-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px var(--color-primary-glow);
}

.branch-item span:first-child {
    font-weight: 600;
}

/* ========== Section title ========== */
.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text);
}

/* ========== Loading ========== */
.spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2.5px solid var(--color-primary-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.btn .spinner {
    width: 1.125rem;
    height: 1.125rem;
    border-color: rgba(255,255,255,0.3);
    border-top-color: #fff;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem;
    color: var(--color-text-muted);
}

/* ========== Blazor overrides ========== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--color-success);
}

.invalid {
    outline: 1px solid var(--color-danger);
}

.validation-message {
    color: var(--color-danger);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* ========== Hamburger button ========== */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.12);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
    transition: background-color 0.15s;
}

.hamburger:hover {
    background: rgba(255,255,255,0.22);
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
}

/* ========== Drawer ========== */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.drawer-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    background: var(--color-surface);
    z-index: 101;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-inline-start: 1px solid var(--color-border);
}

.drawer.open {
    transform: translateX(0);
}

.drawer-header {
    background: var(--color-primary);
    padding: 1.75rem 1.25rem 1.25rem;
    color: #fff;
}

.drawer-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.drawer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.drawer-user-name {
    font-size: 0.9375rem;
    font-weight: 700;
    margin: 0;
}

.drawer-user-email {
    font-size: 0.75rem;
    margin: 0;
    opacity: 0.8;
}

.drawer-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.15s;
    border: none;
    background: none;
    width: 100%;
    font-family: var(--font-family);
    cursor: pointer;
}

.drawer-link:hover {
    background: var(--color-primary-light);
}

.drawer-link.active {
    color: var(--color-primary);
    background: var(--color-primary-surface);
    font-weight: 600;
    border-inline-end: 3px solid var(--color-primary);
}

.drawer-link .icon {
    font-size: 1.25rem;
    width: 1.25rem;
    text-align: center;
    color: var(--color-text-muted);
}

.drawer-link.active .icon {
    color: var(--color-primary);
}

.drawer-divider {
    margin: 0.5rem 1.25rem;
    border: none;
    border-top: 1px solid var(--color-border);
}

/* ========== Theme switcher ========== */
.theme-section {
    padding: 0.5rem 1.25rem 0.75rem;
}

.theme-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin: 0 0 0.625rem;
    font-weight: 500;
}

.theme-switcher {
    display: flex;
    gap: 0.375rem;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    padding: 0.25rem;
    border: 1px solid var(--color-border);
}

.theme-btn {
    flex: 1;
    padding: 0.4375rem 0;
    border: none;
    border-radius: 0.375rem;
    font-family: var(--font-family);
    font-size: 0.75rem;
    cursor: pointer;
    background: transparent;
    color: var(--color-text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: background-color 0.15s, color 0.15s;
}

.theme-btn:hover:not(.active) {
    background: var(--color-primary-light);
}

.theme-btn.active {
    background: var(--color-primary);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 1px 3px var(--color-primary-shadow);
}

.theme-btn .icon {
    font-size: 0.9375rem;
}

/* ========== Drawer footer ========== */
.drawer-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--color-border);
}

.drawer-logout {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.625rem 0;
    border: none;
    background: none;
    font-family: var(--font-family);
    font-size: 0.875rem;
    color: var(--color-danger);
    cursor: pointer;
    font-weight: 500;
}

.drawer-logout:hover {
    opacity: 0.8;
}

.drawer-logout .icon {
    font-size: 1.25rem;
}

/* ========== Order form ========== */
.order-form {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.order-date-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-primary-surface);
    border: 1px solid var(--color-primary-light);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.order-date-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.order-date-value {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-primary);
}

.form-input select,
select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238C6D62' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.875rem center;
    padding-left: 2.5rem;
}

/* ========== Persian Multi-Date Picker ========== */
.pmd {
    position: relative;
}

.pmd-input {
    width: 100%;
    padding: 0.6875rem 0.875rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-input-bg);
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: var(--font-family);
    font-size: 0.9375rem;
}

.pmd-input:hover {
    border-color: var(--color-primary);
}

.pmd-placeholder {
    color: var(--color-text-muted);
    opacity: 0.6;
}

.pmd-summary {
    font-weight: 500;
}

.pmd-chevron {
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

.pmd-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.5rem;
}

.pmd-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--color-primary-surface);
    border: 1px solid var(--color-primary-light);
    border-radius: 2rem;
    padding: 0.25rem 0.5rem 0.25rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-primary);
    font-family: var(--font-family);
    direction: ltr;
}

.pmd-chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border: none;
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.625rem;
    padding: 0;
    font-family: var(--font-family);
    transition: background-color 0.15s;
}

.pmd-chip-remove:hover {
    background: var(--color-primary);
    color: #fff;
}

.pmd-overlay {
    position: fixed;
    inset: 0;
    z-index: 49;
}

.pmd-dropdown {
    position: absolute;
    top: calc(100% + 0.375rem);
    right: 0;
    left: 0;
    z-index: 50;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 0.75rem;
    animation: pmd-fade-in 0.15s ease;
}

@keyframes pmd-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.pmd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.pmd-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-text);
}

.pmd-nav {
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-input-bg);
    color: var(--color-text);
    font-size: 1.125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s, border-color 0.15s;
    font-family: var(--font-family);
}

.pmd-nav:hover {
    border-color: var(--color-primary);
    background: var(--color-primary-surface);
    color: var(--color-primary);
}

.pmd-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid var(--color-border);
}

.pmd-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.125rem;
}

.pmd-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 500;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-text);
    font-family: var(--font-family);
    transition: background-color 0.12s, color 0.12s;
}

.pmd-day:hover:not(:disabled):not(.selected) {
    background: var(--color-primary-light);
}

.pmd-day.today:not(.selected) {
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
    font-weight: 700;
}

.pmd-day.selected {
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
}

.pmd-day.past {
    color: var(--color-text-muted);
    opacity: 0.4;
    cursor: not-allowed;
}

.pmd-day.pmd-blank {
    cursor: default;
}

.pmd-clear-btn {
    display: block;
    width: 100%;
    padding: 0.5rem;
    border: none;
    border-top: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-danger, #e53935);
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.pmd-clear-btn:hover {
    background: var(--color-surface);
}

/* ========== Order progress ========== */
.order-progress {
    position: sticky;
    top: 0;
    z-index: 6;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.625rem;
    padding: 0.625rem 0.875rem;
    margin-bottom: 0.75rem;
}

.order-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.order-progress-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-text);
}

.order-progress-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-primary);
}

.order-progress-track {
    height: 0.5rem;
    background: var(--color-surface);
    border-radius: 0.25rem;
    overflow: hidden;
}

.order-progress-fill {
    height: 100%;
    background: var(--color-success);
    border-radius: 0.25rem;
    min-width: 4px;
    transition: width 0.3s ease;
}

.order-progress-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

/* ========== Product search ========== */
.product-search {
    position: relative;
    margin-bottom: 0.75rem;
}

.product-search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    pointer-events: none;
}

.product-search-input {
    width: 100%;
    padding: 0.625rem 2.25rem 0.625rem 2.25rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-family: var(--font-family);
    background: var(--color-input-bg);
    color: var(--color-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.product-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.product-search-input::placeholder {
    color: var(--color-text-muted);
    opacity: 0.6;
}

.product-search-clear {
    position: absolute;
    left: 0.625rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.25rem;
    font-family: var(--font-family);
}

.search-result-count {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin: 0 0 0.75rem;
}

.search-category-label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.5rem;
}

.search-category-accent {
    width: 3px;
    height: 0.875rem;
    background: var(--color-primary);
    border-radius: 2px;
}

.search-category-label span:last-child {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-primary);
}

/* ========== Category accordion ========== */
.category-tabs {
    display: flex;
    gap: 0.375rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: 4.75rem;
    z-index: 5;
    background: var(--color-surface);
    margin-inline: -0.25rem;
    padding-inline: 0.25rem;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    flex-shrink: 0;
    padding: 0.375rem 0.875rem;
    border-radius: 1.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.category-tab:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.category-tab.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.category-section {
    border: 1.5px solid var(--color-border);
    border-radius: 0.625rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.category-section-header {
    background: var(--color-surface);
    padding: 0.625rem 0.875rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-border);
}

.category-section-accent {
    width: 3px;
    height: 1rem;
    background: var(--color-primary);
    border-radius: 2px;
}

.category-section-title {
    font-size: 0.875rem;
    font-weight: 700;
}

.category-section-badge {
    font-size: 0.6875rem;
    padding: 0.125rem 0.625rem;
    border-radius: 0.75rem;
    background: var(--color-primary-light);
    color: var(--color-text-muted);
    font-weight: 600;
}

/* ========== Product row ========== */
.category-products {
    background: var(--color-surface);
}

.product-row {
    padding: 0.75rem 0.875rem;
    border-bottom: 1px solid var(--color-border);
}

.product-row:last-child {
    border-bottom: none;
}

.product-info {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    margin-bottom: 0.625rem;
}

.product-thumb {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.product-thumb.has-image {
    cursor: pointer;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-thumb-placeholder {
    font-size: 1.5rem;
    opacity: 0.5;
}

.product-details {
    flex: 1;
    min-width: 0;
}

.product-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.1875rem;
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

.meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--color-border);
}

/* ========== Steppers ========== */
.product-steppers {
    display: flex;
    gap: 0.625rem;
}

.stepper-group {
    flex: 1;
}

.stepper-label {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.stepper-label.order-label {
    color: var(--color-primary);
    font-weight: 600;
}

.stepper-unit {
    font-size: 0.625rem;
    font-weight: 400;
    opacity: 0.8;
}

.stepper {
    display: flex;
    align-items: center;
    border: 1.5px solid var(--color-border);
    border-radius: 0.375rem;
    overflow: hidden;
    height: 2.25rem;
}

.order-stepper.has-value {
    border-color: var(--color-primary);
}

.stepper-btn {
    width: 1.875rem;
    height: 100%;
    border: none;
    background: var(--color-bg);
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    cursor: pointer;
    font-family: var(--font-family);
    padding: 0;
    transition: background-color 0.12s;
}

.stepper-btn:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.order-stepper.has-value .stepper-btn {
    background: var(--color-primary-surface);
    color: var(--color-primary);
}

.stepper-value {
    flex: 1;
    border: none;
    text-align: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text);
    font-family: var(--font-family);
    background: var(--color-surface);
    width: 100%;
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

.stepper-value::-webkit-inner-spin-button,
.stepper-value::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.order-stepper.has-value .stepper-value {
    color: var(--color-primary);
    font-weight: 700;
}

/* ========== Confirm bottom sheet ========== */
.confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    animation: confirm-fade 0.2s ease;
}

@keyframes confirm-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.confirm-sheet {
    background: var(--color-bg);
    border-radius: 1rem 1rem 0 0;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: confirm-slide 0.3s ease;
}

@keyframes confirm-slide {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.confirm-handle {
    display: flex;
    justify-content: center;
    padding: 0.625rem 0 0.25rem;
}

.confirm-handle span {
    width: 2.25rem;
    height: 0.25rem;
    background: var(--color-border);
    border-radius: 0.125rem;
}

.confirm-header {
    padding: 0.25rem 1.25rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
}

.confirm-title {
    font-size: 1rem;
    font-weight: 500;
}

.confirm-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.confirm-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
}

.confirm-row-label {
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

.confirm-row-value {
    font-weight: 500;
}

.confirm-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-end;
}

.confirm-date-chip {
    font-size: 0.6875rem;
    background: var(--color-surface);
    padding: 0.1875rem 0.5rem;
    border-radius: var(--radius-sm);
}

.confirm-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 0 0 0.875rem;
}

.confirm-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.625rem;
}

.confirm-products-title {
    font-size: 0.8125rem;
    font-weight: 500;
}

.confirm-products-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-primary);
}

.confirm-product {
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.5rem;
}

.confirm-product-name {
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.confirm-product-amounts {
    display: flex;
    gap: 1rem;
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

.confirm-product-amounts strong {
    font-weight: 500;
    color: var(--color-text);
}

.confirm-product-amounts .order-val {
    color: var(--color-primary);
}

.confirm-footer {
    padding: 0.75rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--color-border);
    display: flex;
    gap: 0.75rem;
}

.confirm-btn-back {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--color-border);
    background: var(--color-bg);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--color-text);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.confirm-btn-back:active {
    background: var(--color-border);
}

.confirm-btn-submit {
    flex: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--color-primary);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.confirm-btn-submit:hover:not(:disabled) {
    background: var(--color-primary-hover);
    box-shadow: 0 4px 12px var(--color-primary-shadow);
}

.confirm-btn-submit:active:not(:disabled) {
    transform: scale(0.98);
}

.confirm-btn-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ========== Order result sheet ========== */
.result-sheet {
    text-align: center;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
}

.result-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.75rem auto 1rem;
}

.result-icon-success {
    background: #e8f5e9;
}

.result-icon-error {
    background: #ffeaea;
}

[data-theme="dark"] .result-icon-success {
    background: rgba(46,125,50,0.2);
}

[data-theme="dark"] .result-icon-error {
    background: rgba(198,40,40,0.2);
}

.result-icon-check,
.result-icon-x {
    display: block;
    width: 1.75rem;
    height: 1.75rem;
    position: relative;
}

.result-icon-check::before,
.result-icon-check::after {
    content: "";
    position: absolute;
    background: #2e7d32;
    border-radius: 1.5px;
}

.result-icon-check::before {
    width: 0.625rem;
    height: 3px;
    bottom: 0.4rem;
    left: 0.15rem;
    transform: rotate(45deg);
}

.result-icon-check::after {
    width: 1.125rem;
    height: 3px;
    bottom: 0.55rem;
    left: 0.45rem;
    transform: rotate(-45deg);
}

[data-theme="dark"] .result-icon-check::before,
[data-theme="dark"] .result-icon-check::after {
    background: #66bb6a;
}

.result-icon-x::before,
.result-icon-x::after {
    content: "";
    position: absolute;
    width: 1.25rem;
    height: 3px;
    background: #c62828;
    border-radius: 1.5px;
    top: 50%;
    left: 50%;
}

.result-icon-x::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.result-icon-x::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

[data-theme="dark"] .result-icon-x::before,
[data-theme="dark"] .result-icon-x::after {
    background: #ef5350;
}

.result-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 0.375rem;
}

.result-title-error {
    color: #c62828;
}

[data-theme="dark"] .result-title-error {
    color: #ef5350;
}

.result-subtitle {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin: 0 0 1.5rem;
    padding: 0 1.25rem;
    line-height: 1.5;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding: 0 1.25rem;
}

.result-btn-export {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--color-primary);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    transition: background 0.15s, transform 0.1s;
}

.result-btn-export:hover:not(:disabled) {
    background: var(--color-primary-hover);
}

.result-btn-export:active:not(:disabled) {
    transform: scale(0.98);
}

.result-btn-export:disabled {
    opacity: 0.6;
    cursor: default;
}

.result-btn-new {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: none;
    background: #e8f5e9;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    color: #2e7d32;
    cursor: pointer;
    transition: background 0.15s;
}

.result-btn-new:active {
    background: #c8e6c9;
}

[data-theme="dark"] .result-btn-new {
    background: rgba(46,125,50,0.2);
    color: #66bb6a;
}

[data-theme="dark"] .result-btn-new:active {
    background: rgba(46,125,50,0.3);
}

.result-btn-retry {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: none;
    background: #ffeaea;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    color: #c62828;
    cursor: pointer;
    transition: background 0.15s;
}

.result-btn-retry:active {
    background: #ffcdd2;
}

[data-theme="dark"] .result-btn-retry {
    background: rgba(198,40,40,0.2);
    color: #ef5350;
}

[data-theme="dark"] .result-btn-retry:active {
    background: rgba(198,40,40,0.3);
}

.result-btn-close {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background 0.15s;
}

.result-btn-close:active {
    background: var(--color-border);
}

/* ========== Image lightbox ========== */
.lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    animation: lightbox-in 0.2s ease;
}

@keyframes lightbox-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-close {
    position: absolute;
    top: -0.5rem;
    left: -0.5rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: none;
    background: var(--color-surface);
    color: var(--color-text);
    font-size: 0.875rem;
    cursor: pointer;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius);
    object-fit: contain;
}

.lightbox-title {
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.75rem;
    text-align: center;
}

#blazor-error-ui {
    display: none;
    background: var(--color-primary-hover);
    color: #fff;
    padding: 0.75rem 1.25rem;
    position: fixed;
    bottom: 0;
    inset-inline: 0;
    z-index: 1000;
    text-align: center;
}

/* ========== Order Requests List ========== */
.orders-page {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.summary-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 0.75rem 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
}

.summary-card.skeleton {
    height: 5rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.summary-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9375rem;
    margin-bottom: 0.125rem;
}

.summary-icon.approved {
    background: #DCFCE7;
    color: #16A34A;
}

.summary-icon.pending {
    background: #FEF3C7;
    color: #D97706;
}

.summary-icon.rejected {
    background: #FEE2E2;
    color: #DC2626;
}

.summary-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.summary-label {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.orders-filter-panel {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 0.625rem 0.75rem;
    margin-bottom: 0.625rem;
}

.filter-row {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.filter-row + .filter-row {
    margin-top: 0.5rem;
}

.filter-field {
    flex: 1;
    min-width: 0;
}

.filter-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.filter-select {
    width: 100%;
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    background: var(--color-bg);
    color: var(--color-text);
    direction: rtl;
    appearance: auto;
}

.filter-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.orders-filter-panel .pmd-input {
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    border-width: 1px;
}

.orders-filter-panel .pmd-chevron {
    font-size: 0.625rem;
}

.filter-icon-btn {
    flex-shrink: 0;
    align-self: flex-end;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    border: none;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filter-icon-btn:hover {
    opacity: 0.9;
}

.orders-filter-tabs {
    display: flex;
    gap: 0.375rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.orders-filter-tabs::-webkit-scrollbar {
    display: none;
}

.filter-tab {
    flex-shrink: 0;
    padding: 0.375rem 0.875rem;
    border-radius: 1.25rem;
    font-size: 0.78125rem;
    font-weight: 600;
    font-family: inherit;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tab:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.filter-tab.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.orders-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
    text-align: center;
}

.orders-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.order-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 0.875rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.order-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px var(--color-primary-glow);
}

.order-card:active {
    transform: scale(0.99);
}

.order-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.order-card-id {
    font-size: 0.9375rem;
    font-weight: 700;
    direction: ltr;
}

.order-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.625rem;
    border-radius: 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
}

.order-status-badge .status-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
}

.status-approved {
    background: #DCFCE7;
    color: #166534;
}

.status-approved .status-dot {
    background: #16A34A;
}

.status-pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-pending .status-dot {
    background: #D97706;
}

.status-rejected {
    background: #FEE2E2;
    color: #991B1B;
}

.status-rejected .status-dot {
    background: #DC2626;
}

.order-card-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.order-card-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--color-text);
}

.order-card-icon {
    font-size: 0.9375rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.order-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.order-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.375rem;
    border-top: 1px solid var(--color-border);
}

.order-card-items {
    font-size: 0.75rem;
    color: var(--color-primary);
    font-weight: 600;
}

.order-card-submitter {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
}

.load-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--color-border);
    border-radius: 0.625rem;
    background: var(--color-surface);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-primary);
    cursor: pointer;
    transition: background 0.15s;
}

.load-more-btn:hover {
    background: var(--color-primary-light);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ========== Order Detail ========== */
.back-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 0.625rem;
    width: 2.125rem;
    height: 2.125rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.35);
}

.header-export-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 0.625rem;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    font-size: 0.8125rem;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.header-export-btn:hover {
    background: rgba(255, 255, 255, 0.35);
}

.header-export-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.order-detail-page {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.detail-info-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.875rem;
    padding: 0.875rem 1rem;
}

.detail-info-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.detail-order-num {
    font-size: 1.125rem;
    font-weight: 700;
    direction: ltr;
}

.detail-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
}

.detail-info-item {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.detail-info-item.detail-full-width {
    grid-column: 1 / -1;
}

.detail-info-icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.0625rem;
}

.detail-info-label {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    display: block;
}

.detail-info-val {
    font-size: 0.84375rem;
    font-weight: 600;
    color: var(--color-text);
    display: block;
    line-height: 1.4;
}

.detail-products-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 0.875rem;
    padding: 0.875rem 1rem;
}

.detail-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.detail-products-title {
    font-size: 0.875rem;
    font-weight: 700;
}

.detail-products-count {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    background: var(--color-primary-light);
    padding: 0.125rem 0.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
}

.detail-category-section {
    border: 1.5px solid var(--color-border);
    border-radius: 0.625rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.detail-category-section .edit-product-card,
.detail-category-section .detail-product-row {
    padding-inline: 0.875rem;
}

.detail-product-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--color-border);
}

.detail-product-row:last-child {
    border-bottom: none;
}

.detail-product-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.detail-thumb {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.detail-thumb.has-image {
    cursor: pointer;
}

.detail-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-product-name {
    font-size: 0.84375rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.detail-product-amounts {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    flex-shrink: 0;
}

.detail-amount {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.6875rem;
}

.detail-amount.stock-amount {
    background: var(--color-bg);
}

.detail-amount.order-amount {
    background: #DCFCE7;
}

html[data-theme="dark"] .detail-amount.order-amount {
    background: rgba(22, 163, 74, 0.15);
}

.detail-amount-label {
    color: var(--color-text-muted);
    font-weight: 500;
}

.detail-amount.order-amount .detail-amount-label {
    color: #166534;
}

html[data-theme="dark"] .detail-amount.order-amount .detail-amount-label {
    color: #4ADE80;
}

.detail-amount-val {
    font-weight: 700;
    color: var(--color-text);
}

.detail-amount.order-amount .detail-amount-val {
    color: #166534;
}

html[data-theme="dark"] .detail-amount.order-amount .detail-amount-val {
    color: #4ADE80;
}

/* dark mode overrides for order status badges */
html[data-theme="dark"] .status-approved {
    background: rgba(22, 163, 74, 0.15);
    color: #4ADE80;
}

html[data-theme="dark"] .status-approved .status-dot {
    background: #4ADE80;
}

html[data-theme="dark"] .status-pending {
    background: rgba(217, 119, 6, 0.15);
    color: #FBBF24;
}

html[data-theme="dark"] .status-pending .status-dot {
    background: #FBBF24;
}

html[data-theme="dark"] .status-rejected {
    background: rgba(220, 38, 38, 0.15);
    color: #F87171;
}

html[data-theme="dark"] .status-rejected .status-dot {
    background: #F87171;
}

html[data-theme="dark"] .summary-icon.approved {
    background: rgba(22, 163, 74, 0.15);
    color: #4ADE80;
}

html[data-theme="dark"] .summary-icon.pending {
    background: rgba(217, 119, 6, 0.15);
    color: #FBBF24;
}

html[data-theme="dark"] .summary-icon.rejected {
    background: rgba(220, 38, 38, 0.15);
    color: #F87171;
}

/* approve/reject actions */
.detail-actions-card {
    background: var(--card-bg, #fff);
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.approval-note-input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 0.625rem;
    padding: 0.625rem 0.75rem;
    font-family: var(--font-family);
    font-size: 0.8125rem;
    resize: none;
    direction: rtl;
    background: var(--card-bg, #fff);
    color: var(--text-primary, #1e293b);
}

html[data-theme="dark"] .approval-note-input {
    border-color: #374151;
    background: #1f2937;
    color: #f1f5f9;
}

.detail-actions-row {
    display: flex;
    gap: 0.625rem;
}

.action-btn {
    flex: 1;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 0.625rem;
    font-family: var(--font-family);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    transition: opacity 0.15s;
}

.action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.approve-btn {
    background: #16a34a;
    color: #fff;
}

.reject-btn {
    background: #dc2626;
    color: #fff;
}

.cancel-btn {
    background: #e5e7eb;
    color: #374151;
}

html[data-theme="dark"] .cancel-btn {
    background: #374151;
    color: #e5e7eb;
}

/* reject confirm modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-dialog {
    background: var(--card-bg, #fff);
    border-radius: 1rem;
    padding: 1.5rem;
    max-width: 20rem;
    width: 100%;
    text-align: center;
    direction: rtl;
}

html[data-theme="dark"] .modal-dialog {
    background: #1f2937;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin-bottom: 0.5rem;
}

html[data-theme="dark"] .modal-title {
    color: #f1f5f9;
}

.modal-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    gap: 0.625rem;
}

/* editable order items */
.edit-product-card {
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 0;
}

.edit-product-card:last-child {
    border-bottom: none;
}

.edit-product-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.edit-product-fields {
    display: flex;
    gap: 0.625rem;
}

.edit-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.edit-field-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--color-text-muted);
}

.edit-amount-input {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.4375rem 0.625rem;
    font-family: var(--font-family);
    font-size: 0.8125rem;
    text-align: center;
    background: var(--color-bg);
    color: var(--color-text);
    -moz-appearance: textfield;
}

.edit-amount-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb, 239, 118, 98), 0.15);
}

.edit-amount-input.order {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.edit-amount-input.order:focus {
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
}

html[data-theme="dark"] .edit-amount-input {
    border-color: #374151;
    background: #1f2937;
    color: #f1f5f9;
}

html[data-theme="dark"] .edit-amount-input.order {
    border-color: rgba(22, 163, 74, 0.3);
    background: rgba(22, 163, 74, 0.1);
}

.edit-amount-input::-webkit-inner-spin-button,
.edit-amount-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.remove-item-btn {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 0.375rem;
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: flex-end;
    transition: background 0.15s;
}

.remove-item-btn:hover {
    background: rgba(220, 38, 38, 0.18);
}

html[data-theme="dark"] .remove-item-btn {
    background: rgba(248, 113, 113, 0.12);
    color: #F87171;
}

/* ========== Product & Category Management ========== */
.pm-content.app-content {
    max-width: 1180px;
}

.pm-page {
    position: relative;
}

.pm-segtabs {
    display: none;
    gap: 0.375rem;
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: 999px;
    padding: 0.25rem;
    margin-bottom: 0.875rem;
}

.pm-segtab {
    flex: 1;
    text-align: center;
    padding: 0.5rem 0;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.pm-segtab.active {
    background: var(--color-primary);
    color: #fff;
}

.pm-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
}

.pm-panel {
    background: var(--color-surface);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.875rem;
}

.pm-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
}

.pm-panel-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-text);
}

.pm-count-pill {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-primary);
    background: var(--color-primary-surface);
    padding: 0.1875rem 0.5625rem;
    border-radius: 999px;
}

.pm-panel-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.625rem;
}

.pm-panel-actions .product-search {
    flex: 1;
    margin-bottom: 0;
}

.pm-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    padding: 0.5rem 0.8125rem;
    border-radius: var(--radius-sm);
    border: none;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.15s;
}

.pm-btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.pm-btn-primary:hover:not(:disabled) {
    background: var(--color-primary-hover);
}

.pm-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pm-empty {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.8125rem;
    padding: 1.5rem 0.5rem;
}

.pm-cat-list, .pm-prod-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.pm-cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--color-bg);
    transition: border-color 0.15s, background-color 0.15s;
}

.pm-cat-row.active {
    border-color: var(--color-primary);
    background: var(--color-primary-surface);
}

.pm-cat-main {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-cat-side {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.pm-count {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--color-text-muted);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    padding: 0.125rem 0.4375rem;
    border-radius: 999px;
}

.pm-icnbtn {
    width: 1.625rem;
    height: 1.625rem;
    border: none;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: background-color 0.15s, color 0.15s;
}

.pm-icnbtn:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.pm-icnbtn.danger:hover {
    background: #FEE2E2;
    color: var(--color-danger);
}

.pm-prod-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
}

.pm-prod-info {
    flex: 1;
    min-width: 0;
}

.pm-prod-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 0.1875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-prod-meta {
    display: flex;
    align-items: center;
    gap: 0.3125rem;
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.pm-badges {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.pm-badge {
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.125rem 0.4375rem;
    border-radius: 999px;
}

.pm-badge.on {
    background: #DCFCE7;
    color: #166534;
}

.pm-badge.off {
    background: var(--color-border);
    color: var(--color-text-muted);
}

html[data-theme="dark"] .pm-badge.on {
    background: rgba(22, 163, 74, 0.15);
    color: #4ADE80;
}

.pm-prod-actions {
    display: flex;
    gap: 0.125rem;
    flex-shrink: 0;
}

.pm-fab {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    left: 1.25rem;
    z-index: 90;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: none;
    background: var(--color-primary);
    color: #fff;
    font-size: 1.375rem;
    box-shadow: var(--shadow-btn), 0 4px 16px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.pm-imgbox {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3125rem;
    border: 1.5px dashed var(--color-border);
    border-radius: var(--radius-sm);
    padding: 1.125rem;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    margin-bottom: 0.875rem;
    background: var(--color-bg);
    cursor: pointer;
    overflow: hidden;
}

.pm-imgbox img {
    max-width: 100%;
    max-height: 8rem;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.pm-image-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.pm-switchrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-top: 1px solid var(--color-border);
}

.pm-switchrow:first-of-type {
    border-top: none;
}

.pm-switchrow span {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-text);
}

.pm-switch {
    position: relative;
    width: 2.375rem;
    height: 1.375rem;
    flex-shrink: 0;
}

.pm-switch input {
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.pm-track {
    position: absolute;
    inset: 0;
    background: var(--color-border);
    border-radius: 999px;
    pointer-events: none;
    transition: background-color 0.15s;
}

.pm-thumb {
    position: absolute;
    top: 0.125rem;
    right: 0.125rem;
    width: 1.125rem;
    height: 1.125rem;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    transition: transform 0.15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.pm-switch input:checked ~ .pm-track {
    background: var(--color-success);
}

.pm-switch input:checked ~ .pm-thumb {
    transform: translateX(-1rem);
}

@media (max-width: 700px) {
    .pm-segtabs {
        display: flex;
    }

    .pm-body {
        display: block;
    }

    .pm-cat-panel, .pm-prod-panel {
        display: none;
    }

    .pm-cat-panel.pm-hide-mobile, .pm-prod-panel.pm-hide-mobile {
        display: none;
    }

    .pm-cat-panel:not(.pm-hide-mobile), .pm-prod-panel:not(.pm-hide-mobile) {
        display: block;
    }

    .pm-panel-head .pm-btn-primary {
        display: none;
    }

    .pm-fab {
        display: flex;
    }
}

@media (min-width: 701px) {
    .pm-body {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 1.25rem;
        align-items: start;
    }

    .pm-panel {
        padding: 1.125rem;
    }

    .pm-cat-panel {
        position: sticky;
        top: 1.25rem;
        max-height: calc(100dvh - 2.5rem);
        overflow-y: auto;
    }

    .pm-cat-list {
        gap: 0.5rem;
    }

    .pm-prod-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr));
        gap: 0.625rem;
    }

    .pm-prod-row {
        align-items: flex-start;
    }
}

/* ========== Scroll FAB ========== */
.scroll-fab {
    position: fixed;
    bottom: 1.5rem;
    left: 1.25rem;
    z-index: 90;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: none;
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 10px var(--color-primary-shadow), 0 4px 16px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.6);
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s, background-color 0.2s;
}

.scroll-fab.visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.scroll-fab:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 4px 14px var(--color-primary-shadow), 0 6px 20px rgba(0, 0, 0, 0.12);
}

.scroll-fab:active {
    transform: scale(0.92);
}

.scroll-fab-icon {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s ease;
}

.scroll-fab.at-bottom .scroll-fab-icon {
    transform: rotate(180deg);
}
