﻿html,
body {
  background: var(--color-background);
  color: var(--color-text-primary);
  font-family: var(--font-family-primary);
}
:root {
    --lp-red: #EA2831;
    --lp-red-dark: #c41f27;
}

/* ── MudBlazor z-index overrides ────────────────────────────────────────────
   MudBlazor's default dialog z-index is ~1300 and snackbar ~1400.
   Both are below the mobile bottom nav (10000), mobile overlay (10020), and
   overflow menu (10029/10030). Override here so dialogs and snackbars always
   appear on top of every app layer.
   10050 = dialog (above overlay 10020, below mandatory-update 20000)
   10060 = dialog overlay/backdrop (must be just below dialog container)
   10070 = snackbar (above dialog so error toasts are always visible)
*/
.mud-dialog-root {
    z-index: 10050 !important;
}
.mud-dialog .mud-dialog-content {
    padding: 0px 14px !important;
}
#mud-snackbar-container {
    /* 10070 per the scheme above — must sit ABOVE the dialog (10050) AND the Bootstrap .modal
       used by the payment popups (10055, defined later in this file), otherwise snackbar alerts
       render behind the open payment popup. */
    z-index: 10070 !important;
}
/* Shrink dialog root's usable area on mobile so dialogs don't render
   behind the bottom nav bar. */
@media (max-width: 767px) {
    .mud-dialog-root {
        padding-bottom: var(--mobile-bottom-nav-height, 64px);
        box-sizing: border-box;
    }
}
/* ── Global mobile layout helpers ──────────────────────────────────────────
   AppShell.razor.css is scoped to AppShell.razor; these classes are used by
   MobileLayout.razor (a different component) so they MUST live here (global). */
.app-content-mobile {
    min-height: 100dvh;
    padding-bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0) + 16px);
}
.mobile-main-content {
    padding-bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0) + 16px);
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    background: #f1f5f9;
    font-family: 'Inter', sans-serif;
}

/* ── Left image panel ─────────────────────────────────────────────────────── */
.login-left {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
    overflow: hidden;
    display: none; /* hidden on mobile */
}

@media (min-width: 900px) {
    .login-left { display: flex; }
}

.login-left-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.login-left-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(234,40,49,.82) 0%, rgba(100,10,14,.7) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 48px 44px;
}

.login-left-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 99px;
    padding: 6px 16px 6px 8px;
    font-size: 13px;
    color: #fff;
    font-weight: 600;
    margin-bottom: 20px;
    width: fit-content;
}

.login-left-title {
    font-size: 36px;
    font-weight: 900;
    color: #fff;
    line-height: 1.15;
    letter-spacing: -.5px;
    margin-bottom: 14px;
}

.login-left-sub {
    font-size: 15px;
    color: rgba(255,255,255,.8);
    line-height: 1.6;
    max-width: 360px;
}

.login-left-dots {
    display: flex;
    gap: 6px;
    margin-top: 32px;
}

.login-left-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,.35);
}

.login-left-dot.active { background: #fff; width: 24px; border-radius: 4px; }

/* ── Right form panel ─────────────────────────────────────────────────────── */
.login-right {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    box-shadow: -2px 0 32px rgba(0,0,0,.07);
}

@media (min-width: 900px) {
    .login-right { min-width: 480px; }
}

.login-inner {
    width: 100%;
    max-width: 400px;
}
.dashboard-sales-card {
    margin-bottom: var(--space-sm);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
}
/* Brand */
.lp-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 28px;
}

.lp-brand-icon {
    width: 40px; height: 40px;
    background: var(--lp-red);
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lp-brand-name {
    font-size: 20px;
    font-weight: 900;
    color: #121417;
    letter-spacing: -.4px;
}

.lp-brand-tagline {
    font-size: 12px;
    color: #94a3b8;
    font-weight: 400;
    margin-top: 1px;
}

/* Headings */
.lp-heading { font-size: 22px; font-weight: 800; color: #121417; letter-spacing: -.3px; margin-bottom: 4px; }
.lp-subheading { font-size: 13.5px; color: #64748b; margin-bottom: 24px; }

/* Tabs */
.lp-tabs {
    display: flex;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 22px;
    gap: 0;
}

.lp-tab {
    background: none;
    border: none;
    padding: 8px 0 10px;
    margin-right: 18px;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.lp-tab.active {
    color: #121417;
    border-bottom-color: var(--lp-red);
}

.lp-tab:hover:not(.active) { color: #475569; }

/* Panes */
.lp-pane { display: none; }
.lp-pane.active { display: block; }

/* Labels & inputs */
.lp-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.lp-input {
    width: 100%;
    padding: 11px 13px;
    font-size: 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px !important;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    background: #fff;
    color: #121417;
    font-family: inherit;
}
.lp-input-rounded {
    border-radius: 18px !important;
}
.lp-input-sm {
    padding: 7px 11px;
}
.lp-input:focus {
    border-color: var(--lp-red);
    box-shadow: 0 0 0 3px rgba(234,40,49,.1);
}
.form-control:focus {
    border-color: var(--lp-red) !important;
    box-shadow: 0 0 0 3px rgba(234,40,49,.1) !important;
}

.lp-input:disabled {
    background-color: #f5f5f5;
    border-color: #ddd;
    color: #999;
    cursor: not-allowed;
    opacity: 0.7;
}

.lp-input:disabled::placeholder {
    color: #aaa;
}

.lp-input::placeholder { color: #b0bac8; }

.lp-input-wrap { position: relative; margin-bottom: 16px; }

.lp-pw-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    line-height: 1;
}

.lp-pw-toggle:hover { color: #475569; }

/* OTP box */
.lp-otp-input {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 12px;
    text-align: center;
    font-family: 'Courier New', monospace;
    padding: 12px 10px;
}

/* Buttons */
.lp-btn {
    width: 100%;
    padding: 12.5px;
    background: var(--lp-red);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, box-shadow .15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-family: inherit;
}

.lp-btn:hover:not(:disabled) {
    background: var(--lp-red-dark);
    box-shadow: 0 4px 14px rgba(234,40,49,.3);
}

.lp-btn:disabled { opacity: .6; cursor: default; }

.lp-btn-ghost {
    background: none;
    border: none;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 0;
    width: 100%;
    text-align: center;
    font-family: inherit;
    margin-top: 4px;
}

.lp-btn-ghost:hover { color: #334155; }

.lp-resend-btn {
    background: none;
    border: none;
    color: var(--lp-red);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.lp-resend-btn:disabled { opacity: .45; cursor: default; }

/* Alerts */
.lp-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 13px;
    border-radius: 9px;
    font-size: 13px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.lp-alert-error   { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.lp-alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }

/* Remember row */
.lp-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.lp-remember {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

.lp-remember input[type=checkbox] {
    accent-color: var(--lp-red);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* Divider */
.lp-divider { border: none; border-top: 1px solid #f1f5f9; margin: 20px 0 16px; }

/* Footer */
.lp-footer { text-align: center; font-size: 12.5px; color: #94a3b8; }
.lp-footer a { color: var(--lp-red); text-decoration: none; font-weight: 600; }
.lp-footer a:hover { text-decoration: underline; }

/* Spinner */
.lp-spin {
    width: 17px; height: 17px;
    border: 2.5px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lp-spin .65s linear infinite;
    flex-shrink: 0;
}

@keyframes lp-spin { to { transform: rotate(360deg); } }

/* Material icon helper */
.mi { font-family: 'Material Symbols Outlined'; font-weight: normal; font-style: normal; font-size: inherit; line-height: 1; vertical-align: middle; display: inline-block; }

/* Phone prefix */
.lp-phone-wrap { display: flex; gap: 8px; align-items: stretch; margin-bottom: 16px; }
.lp-phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    background: #f8fafc;
    white-space: nowrap;
    flex-shrink: 0;
}
.lp-phone-wrap .lp-input { margin-bottom: 0; flex: 1; }

/* Step indicator */
.lp-steps { display: flex; gap: 6px; margin-bottom: 18px; }
.lp-step-dot { flex: 1; height: 3px; border-radius: 2px; background: #e5e7eb; transition: background .2s; }
.lp-step-dot.done { background: var(--lp-red); }

.material-symbols-outlined {
  font-family: var(--font-family-secondary);
  font-weight: 400;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
}
.mud-navmenu.mud-navmenu-secondary .mud-nav-link.active:not(.mud-nav-link-disabled) {
    color: var(--mud-palette-secondary);
    --mud-ripple-color: var(--mud-palette-secondary);
    background-color: var(--button-primary-outline-bg) !important;
}
.btn-success {
    --bs-btn-color: #fff;
    --bs-btn-bg: #20c997 !important;
    --bs-btn-border-color: #20c997 !important;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #20c997;
    --bs-btn-hover-border-color: #20c997 !important;
    --bs-btn-focus-shadow-rgb: 60, 153, 110;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #20c997 !important;
    --bs-btn-active-border-color: #20c997 !important;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #20c997 !important;
    --bs-btn-disabled-border-color: #20c997 !important;
}
.btn-outline-success:hover {
    background: #20c997 !important;
    color: var(--button-primary-text) !important;
    border: #20c997 !important;
}
.btn-outline-success {
    background: #20c997 !important;
    color: var(--button-primary-text) !important;
    border: #20c997 !important;
}
.btn {
    border-radius: var(--radius-pill);
    padding: var(--button-primary-padding);
    /*padding: var(--space-sm) var(--space-md);*/
    font-size: var(--font-size-sm);
    /*min-width:100px;*/
}
/* Buttons */
.btn-secondary {
    color: var(--button-primary-text) !important;
    transition: var(--transition-normal) !important;
    background-color: var(--button-secondary-bg) !important;
    border-color: var(--button-secondary-bg) !important;
}
.btn-primary {
    background: var(--button-primary-bg) !important;
    color: var(--button-primary-text) !important;
    border: var(--button-primary-border) !important;
    transition: var(--transition-normal) !important;
}
    .btn-primary:hover {
        background: var(--button-primary-hover-bg) !important;
        box-shadow: var(--button-primary-hover-shadow) !important;
    }
.btn-outline-primary:hover {
    background: var(--button-primary-bg) !important;
    color: var(--button-primary-text) !important;
    border: var(--button-primary-border) !important;
}
.btn-secondary:hover {
    box-shadow: var(--button-secondary-hover-shadow) !important;
}
.btn-outline-secondary:hover {
    color: var(--button-primary-text) !important;
    transition: var(--transition-normal) !important;
    background-color: var(--button-secondary-bg) !important;
    border-color: var(--button-secondary-bg) !important;
}
.btn-sm {
    min-height: var(--mobile-tap-target-min);
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-sm);
}
.btn-primary:active {
  transform: translateY(var(--space-xs));
}
.btn-outline-primary {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--button-primary-outline-bg);
}
.btn-outline-secondary {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
    background: var(--button-secondary-outline-bg);
}
.btn-ghost {
    background: var(--button-ghost-bg);
    color: var(--button-ghost-text);
    border: var(--button-ghost-border);
    border-radius: var(--button-ghost-radius);
    padding: var(--button-ghost-padding);
    transition: var(--transition-fast);
}

.btn-ghost:hover {
  background: var(--nav-item-active-bg);
  color: var(--color-primary);
}

.btn-lg {
  min-height: var(--mobile-form-button-height);
  padding: var(--space-md) var(--space-xl);
  font-size: var(--font-size-lg);
}

.btn-full {
  width: 100%;
}
textarea.form-control
{
    padding:.8rem !important;
}
.radius-right-rounded
{
    border-top-right-radius: 99px !important;
    border-bottom-right-radius: 99px !important;
}
.radius-left-rounded
{
    border-top-left-radius: 99px !important;
    border-bottom-left-radius: 99px !important;
}
.form-control, .form-input, .form-select {
    display: block;
    width: 100%;
    min-width:70px !important;
    padding: .475rem .75rem !important;
    font-size: 14px;
    transition: border-color 0.2s;
    font-weight: 400;
    line-height: 1.8;
    color: var(--bs-body-color);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fcfdfffa;
    background-clip: padding-box;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: 99px !important;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.form-control-sm {
    min-height: calc(1.5em + .5rem + calc(var(--bs-border-width) * 2));
    padding: .25rem .5rem !important;
}
    /* Cards and surfaces */
    .card {
        background: var(--card-bg);
        border: var(--card-border);
        border-radius: var(--card-radius);
    }

    .card-header {
        padding: var(--space-lg) var(--space-xl);
        border-bottom: var(--border-width) solid var(--color-border-light);
        font-weight: var(--font-weight-semibold);
    }

    .card-body {
        padding: var(--card-padding);
    }

    .card-footer {
        padding: var(--space-md) var(--space-xl);
        border-top: var(--border-width) solid var(--color-border-light);
    }

    .surface {
        background: var(--color-surface);
        border: var(--border-width) solid var(--color-border-light);
        border-radius: var(--radius-lg);
    }
    /* Stat cards */
    .stat-card {
        background: var(--stat-card-bg);
        border: var(--stat-card-border);
        border-radius: var(--stat-card-radius);
        padding: 10px;
    }

    .stat-card-value {
        font-size: 22px;
        font-weight: 600;
        line-height: 1.13;
        color: var(--color-text-secondary);
    }

    .stat-card-label {
        font-size: var(--mobile-stat-card-label-size);
        color: var(--mobile-stat-card-label-color);
    }

    .stat-card-change-up {
        color: var(--color-success);
        font-size: var(--mobile-stat-card-change-size);
    }

    .stat-card-change-down {
        color: var(--color-danger);
        font-size: var(--mobile-stat-card-change-size);
    }
    /* Forms */
    .form-group {
        margin-bottom: var(--mobile-form-group-margin-bottom);
    }

    .form-label {
        display: block;
        margin-bottom: var(--mobile-form-label-margin-bottom);
        color: var(--mobile-form-label-color);
        font-size: var(--mobile-form-label-size);
        font-weight: var(--font-weight-medium);
    }

    .form-input,
    .form-select {
        width: 100%;
        border: var(--input-border);
        border-radius: var(--input-radius);
        color: var(--color-text-primary);
        padding: var(--input-padding);
        font-size: var(--mobile-form-input-size);
        transition: var(--transition-fast);
    }

    .form-select {
        background-color: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
        background-repeat: no-repeat;
        background-position: right 0.65rem center;
        background-size: 16px 12px;
        min-height: calc(1.5em + .5rem + calc(var(--bs-border-width) * 2));
        background-color: #fcfdfffa;
        font-size: 14px;
    }

    .form-input::placeholder {
        color: var(--input-placeholder);
    }

    .form-input:focus,
    .form-select:focus {
    border-color: var(--lp-red) !important;
    box-shadow: 0 0 0 3px rgba(234,40,49,.1) !important;
}
    .form-select-sm
    {
        padding: .25rem .5rem !important;
    }

    .form-input.error {
        border-color: var(--color-danger);
        box-shadow: none;
    }

    .form-error-text {
        color: var(--color-danger);
        font-size: var(--font-size-xs);
        margin-top: var(--space-xs);
    }
    /* Badges and chips */
    .badge {
        display: inline-flex;
        align-items: center;
        border-radius: var(--badge-radius);
        padding: var(--mobile-status-padding);
        font-size: var(--mobile-status-size);
        font-weight: var(--mobile-status-weight);
        line-height: var(--line-height-tight);
    }

    .badge-success {
        background: var(--mobile-status-delivered-bg);
        color: var(--mobile-status-delivered-text);
    }

    .badge-warning {
        background: var(--mobile-status-shipped-bg);
        color: var(--mobile-status-shipped-text);
    }

    .badge-danger {
        background: var(--mobile-status-pending-bg);
        color: var(--mobile-status-pending-text);
    }

    .badge-info {
        background: var(--mobile-status-shipped-bg);
        color: var(--mobile-status-shipped-text);
    }

    .badge-neutral {
        background: var(--mobile-status-cancelled-bg);
        color: var(--mobile-status-cancelled-text);
    }

    .chip {
        display: inline-flex;
        align-items: center;
        gap: var(--space-xs);
        border: var(--border-width) solid var(--color-border);
        border-radius: var(--radius-pill);
        padding: var(--space-xs) var(--space-sm);
        background: var(--color-surface);
        font-size: var(--font-size-sm);
    }

    .chip-removable {
        padding-right: var(--space-md);
    }
    /* Loading */
    .spinner {
        width: var(--mobile-tap-target-min);
        height: var(--mobile-tap-target-min);
        border: var(--border-width) solid var(--color-border);
        border-top-color: var(--color-primary);
        border-radius: var(--radius-pill);
        animation: spin var(--transition-slow) infinite linear;
    }

    @keyframes spin {
        to {
            transform: rotate(360deg);
        }
    }
    /* List items */
    .list-item {
        min-height: var(--mobile-list-item-min-height);
        display: grid;
        grid-template-columns: var(--mobile-list-thumbnail-size) minmax(0, 1fr) auto;
        gap: var(--space-md);
        align-items: center;
        padding: var(--space-md);
        border-bottom: var(--table-row-border-bottom);
        transition: var(--transition-fast);
    }

        .list-item:hover {
            background: var(--table-row-hover-bg);
        }

    .list-item-active {
        background: var(--nav-item-active-bg);
    }

    .list-item-thumbnail {
        width: var(--mobile-list-thumbnail-size);
        height: var(--mobile-list-thumbnail-size);
        border-radius: var(--mobile-list-thumbnail-radius);
        overflow: hidden;
    }

    .list-item-content {
        min-width: 0;
    }

    .list-item-price {
        text-align: right;
        font-size: var(--mobile-list-price-size);
        font-weight: var(--mobile-list-price-weight);
    }

    .list-item-card {
        background: #fdfdfd;
        padding: 11px;
        margin-bottom: 4px;
        cursor: pointer;
        transition: var(--transition-fast);
        /*border-radius: 7px;*/
        /*box-shadow: 2px 1px 11px -6px #b7bcd1 !important;*/
        border-left: 4px solid var(--color-primary) !important;
        border: 1px solid var(--border-color);
        border-radius:7px !important;
    }

        .list-item-card:active {
            background: var(--color-surface-secondary);
        }

    .list-item-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .list-item-title {
        font-weight: 500;
        font-size: var(--font-size-base);
    }

    .list-item-subtitle {
        font-size: var(--font-size-sm);
        color: var(--color-text-secondary);
    }

    .list-item-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .list-item-date {
        font-size: var(--font-size-xs);
        color: var(--color-text-muted);
    }

    .list-item-amount {
        font-weight: 600;
        font-size: .9em;
        color: var(--color-text-secondary);
    }
    /* Navigation */
    .bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0));
        background: var(--mobile-bottom-nav-background);
        border-top: var(--mobile-bottom-nav-border-top);
        padding-bottom: env(safe-area-inset-bottom, 0);
        box-sizing: border-box;
        display: grid !important;
        grid-template-columns: repeat(var(--mobile-bottom-nav-item-count), minmax(0, 1fr));
        z-index: 10000;
    }

    .bottom-nav-item {
        border: 0;
        background: transparent;
        color: var(--mobile-bottom-nav-inactive-color);
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: var(--mobile-tap-target-min);
        text-decoration: none;
        gap: 2px;
    }

        .bottom-nav-item.active {
            color: var(--mobile-bottom-nav-active-color);
        }

    .bottom-nav-icon {
        font-size: var(--mobile-bottom-nav-icon-size);
    }

    .bottom-nav-label {
        margin-top: var(--mobile-bottom-nav-label-margin-top);
        font-size: var(--mobile-bottom-nav-label-size);
    }

    .filter-tab-item {
        padding: var(--mobile-filter-padding);
        font-size: var(--mobile-filter-size);
        font-weight: var(--mobile-filter-weight-inactive);
        color: var(--color-text-muted);
        border-bottom: var(--mobile-filter-indicator) solid transparent;
        white-space: nowrap;
    }

        .filter-tab-item.active {
            color: var(--color-primary);
            font-weight: var(--mobile-filter-weight-active);
            border-bottom-color: var(--color-primary);
        }
    /* Settings */
    .settings-row {
        min-height: var(--mobile-settings-row-height);
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: var(--border-width) solid var(--color-border-light);
        font-size: var(--mobile-settings-label-size);
    }

    .settings-toggle {
        position: relative;
        width: var(--mobile-toggle-width);
        height: var(--mobile-toggle-height);
    }

        .settings-toggle input {
            position: absolute;
            opacity: 0;
            width: 0;
            height: 0;
        }

        .settings-toggle .slider {
            position: absolute;
            inset: 0;
            background: var(--color-border);
            border-radius: var(--radius-pill);
            transition: var(--transition-fast);
        }

            .settings-toggle .slider::before {
                content: "";
                position: absolute;
                width: var(--mobile-toggle-thumb-size);
                height: var(--mobile-toggle-thumb-size);
                left: var(--space-xs);
                bottom: var(--space-xs);
                background: var(--color-surface);
                border-radius: var(--radius-pill);
                transition: var(--transition-fast);
            }

        .settings-toggle input:checked + .slider {
            background: var(--color-primary);
        }

            .settings-toggle input:checked + .slider::before {
                transform: translateX(var(--space-lg));
            }
    /* Detail page */
    .detail-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-md);
    }

    .detail-label {
        font-size: var(--mobile-detail-label-size);
        color: var(--mobile-detail-label-color);
    }

    .detail-value {
        font-size: var(--mobile-detail-value-size);
        font-weight: var(--mobile-detail-value-weight);
        padding: var(--mobile-detail-row-padding);
    }
    /* Subscription card */
    .subscription-card {
        background: var(--mobile-subscription-bg);
        color: var(--mobile-subscription-text);
        border-radius: var(--mobile-subscription-radius);
        padding: var(--mobile-subscription-padding);
        box-shadow: var(--shadow-card);
    }
    /* Page structure */
    .page-header {
        min-height: var(--mobile-top-bar-height);
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 var(--mobile-content-padding);
    }

    .mobile-header-btn, .mobile-profile-btn {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        border: 1px solid var(--color-border-light);
        background: #fbfbfb;
        color: #515e71;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none
    }

    .mobile-overlay-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(18, 20, 23, 0.38);
        z-index: 10050;
    }

    .mobile-bottom-sheet {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 10060;
        background: var(--color-surface);
        border-top-left-radius: 24px;
        border-top-right-radius: 24px;
        padding: var(--space-lg);
        box-shadow: var(--shadow-modal);
        max-height: 78vh;
        overflow-y: auto;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    .mobile-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: var(--space-md);
    }

        .mobile-sheet-header h2 {
            font-size: var(--font-size-xl);
            font-weight: var(--font-weight-semibold);
        }

    .mobile-sheet-group {
        margin-bottom: 12px;
    }

    .mobile-sheet-group-title {
        font-size: 0.7rem;
        font-weight: 600;
        color: var(--color-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
        margin-bottom: 6px;
        padding-left: 2px;
    }

    .mobile-sheet-grid {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px 2px;
    }

    .mobile-sheet-link {
        border: none;
        border-radius: var(--radius-md);
        padding: 8px 2px 6px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        text-decoration: none;
        color: var(--color-text-primary);
        font-size: 0.68rem;
        font-weight: 500;
        text-align: center;
        line-height: 1.25;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-sheet-link:hover, .mobile-sheet-link:active {
        background: var(--color-surface-secondary);
    }

    .mobile-sheet-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .sheet-icon-primary {
        background: color-mix(in srgb, var(--color-primary) 16%, white);
        color: var(--color-primary);
    }

    .sheet-icon-success {
        background: color-mix(in srgb, var(--color-success) 16%, white);
        color: var(--color-success);
    }

    .sheet-icon-info {
        background: color-mix(in srgb, var(--color-info) 16%, white);
        color: var(--color-info);
    }

    .sheet-icon-warning {
        background: color-mix(in srgb, var(--color-warning) 18%, white);
        color: var(--color-warning);
    }

    .sheet-icon-danger {
        background: color-mix(in srgb, var(--color-danger) 16%, white);
        color: var(--color-danger);
    }

    .sheet-icon-muted {
        background: var(--color-surface-secondary);
        color: var(--color-text-secondary);
    }

    /* ── Dashboard Quick Actions (mobile-only, above charts) ──────────────── */
    .dash-quick-actions {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        padding: 10px 6px 8px;
    }

    .dash-quick-grid {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .dash-quick-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        padding: 6px 0px;
        border: none;
        background: transparent;
        color: var(--color-text-primary);
        border-radius: var(--radius-md);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .dash-quick-item:active {
        background: var(--color-surface-secondary);
    }

    .dash-quick-label {
        font-size: 0.63rem;
        font-weight: 500;
        text-align: center;
        line-height: 1.2;
        color: var(--color-text-secondary);
        word-break: break-word;
    }

    .mobile-search-overlay {
        position: fixed;
        inset: 0;
        z-index: 1100;
        background: var(--color-surface);
        display: flex;
        flex-direction: column;
        /* top/bottom pad for system bars. --safe-area-inset-* injected by MAUI native (MAUI #33103 fix);
           falls back to env() for iOS/browser where it works natively. */
        padding: calc(var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) + var(--space-sm)) var(--space-sm) calc(var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)) + var(--space-sm));
        overscroll-behavior: contain;
        /* Prevent MAUI Android WebView pull-to-refresh from intercepting downward swipes */
        touch-action: pan-y;
    }

    .mobile-search-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: var(--space-md);
    }

    .mobile-search-input-wrap {
        border: 1px solid var(--color-border);
        border-radius: 40px;
        display: flex;
        align-items: center;
        gap: var(--space-sm);
        padding: 0 var(--space-md);
        min-height: 40px;
    }

    .mobile-search-input {
        border: none;
        outline: none;
        width: 100%;
        font-size: var(--font-size-base);
        background: transparent;
    }

    .mobile-search-clear {
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
        color: var(--color-text-secondary);
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

        .mobile-search-clear .material-symbols-outlined {
            font-size: 18px;
        }

    .mobile-search-filter-row {
        display: flex;
        gap: var(--space-sm);
        margin-top: var(--space-md);
        margin-bottom: var(--space-md);
        overflow-x: auto;
        min-height: 30px;
    }

    .mobile-filter-chip {
        border: 1px solid var(--color-border);
        background: var(--color-surface);
        border-radius: var(--radius-pill);
        padding: var(--space-xs) var(--space-md);
        white-space: nowrap;
    }

        .mobile-filter-chip.active {
            border-color: var(--color-primary);
            color: var(--color-primary);
            background: color-mix(in srgb, var(--color-primary) 10%, white);
        }

    .mobile-search-results {
        display: grid;
        gap: var(--space-sm);
        overflow-y: auto;
        /* account for bottom nav (z:10000) sitting above the search overlay (z:1100) */
        padding-bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0px) + var(--space-md));
        overscroll-behavior: contain;
    }

    .mobile-search-result {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        padding: var(--space-sm);
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: var(--space-sm);
        text-decoration: none;
        color: var(--color-primary);
        /* support <button> element as well as <a> */
        background: none;
        width: 100%;
        text-align: left;
        cursor: pointer;
    }

    .mobile-search-result-icon {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        /*background: color-mix(in srgb, var(--color-primary) 10%, white);*/
    }

    .mobile-search-result-content {
        display: flex;
        flex-direction: column;
    }

        .mobile-search-result-content strong {
            font-size: var(--font-size-base);
        }

    @media (max-width: 768px) {
        /* Full-width dialogs on mobile — use flex column + dvh so title/content/actions stay in view */
        .mud-dialog {
            width: 100vw !important;
            max-width: 100vw !important;
            margin: 0 !important;
            border-radius: 0 !important;
            max-height: 100dvh;
            min-height: unset;
            display: flex !important;
            flex-direction: column !important;
        }

        /* Reusable Floating Action Button (FAB)
           - Use .rm-fab on any button for a single floating button.
           - Use .rm-fab-stack as a container when multiple FABs are needed.
           - .mobile-fixed-button kept as backward-compatible alias. */
        .mobile-fixed-button,
        .rm-fab {
            position: fixed;
            bottom: 15%;
            right: 5%;
            width: 45px !important;
            box-shadow: var(--shadow-card);
            height: 45px !important;
            display: flex;
            min-width: 45px !important;
            align-items: center;
            justify-content: center;
            border-radius: 50% !important;
            z-index: 1040;
        }

        .rm-fab-stack {
            position: fixed;
            right: 5%;
            bottom: 15%;
            display: flex;
            flex-direction: column;
            gap: 8px;
            z-index: 1040;
        }

        .rm-fab-stack .rm-fab {
            position: static;
            bottom: auto;
            right: auto;
        }

        .mud-dialog-content {
            flex: 1 1 auto;
            min-height: 0;
            max-height: none;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            /* Prevent MAUI Android WebView pull-to-refresh from intercepting downward swipes,
               which blocks the user from scrolling back to the top of dialog content. */
            touch-action: pan-y;
            overscroll-behavior: contain;
        }

        .mud-dialog-actions {
            flex-shrink: 0;
            position: sticky;
            bottom: 0;
            z-index: 3;
            padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0));
            background: var(--mud-palette-surface, #fff);
            border-top: 1px solid var(--mud-palette-lines-default, rgba(0, 0, 0, 0.12));
        }
    }

    .mobile-search-result-content small {
        color: var(--color-text-secondary);
    }

    .desktop-topbar {
        min-height: 50px;
        border-bottom: 2px solid var(--color-border);
        background: var(--color-surface);
        padding: 0 var(--space-lg);
    }

    .desktop-topbar-right {
        display: flex;
        align-items: center;
        gap: var(--space-sm);
    }

    .desktop-topbar-link {
        display: inline-flex;
        align-items: center;
        gap: var(--space-xs);
        text-decoration: none;
        color: var(--color-text-primary);
        border: 2px solid var(--color-border);
        border-radius: var(--radius-md);
        padding: var(--space-xs) var(--space-sm);
    }

    .desktop-topbar-avatar {
        width: 36px;
        height: 36px;
        border-radius: 12px;
        border: 2px solid var(--color-border);
        color: var(--color-text-primary);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }

    .page-title {
        font-size: var(--mobile-top-bar-title-size);
        font-weight: var(--mobile-top-bar-title-weight);
    }

    .section-title {
        font-size: var(--font-size-xl);
        font-weight: var(--font-weight-semibold);
    }

    .section-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--space-md);
    }

    .section-header-action {
        flex-shrink: 0;
    }

    .dashboard-caption {
        font-size: var(--font-size-xs);
    }

    .dashboard-chart-row {
        align-items: stretch;
    }

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

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

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

    .divider {
        border: 0;
        border-top: var(--border-width) solid var(--color-border-light);
        margin: var(--space-md) 0;
    }

    .empty-state {
        text-align: center;
        padding: var(--space-2xl);
    }
    /* Responsive utilities */
    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none;
    }
    /* Sidebar search + profile/settings shared UI */
    .sidebar-search-input .mud-input-slot {
        background: var(--color-surface);
    }

    .sidebar-search-results {
        border: 1px solid var(--color-border-light);
        border-radius: var(--radius-md);
        overflow: hidden;
    }

    .profile-page-shell .profile-card .mud-avatar {
        border: 2px solid var(--color-border-light);
        background: var(--color-surface);
    }

    .settings-shell {
        border-radius: var(--radius-md);
    }

    .settings-edit-form .validation-summary-errors {
        margin-bottom: var(--space-sm);
    }

    .settings-tabs .mud-tabs-panels {
        background: var(--color-surface);
        border: 1px solid var(--color-border-light);
    }

    .settings-tab-panel {
        padding: var(--space-md);
    }
    /* Core module compact shells */
    .module-shell {
        border: 1px solid var(--color-border-light);
        border-radius: var(--radius-md);
        background: var(--color-surface);
    }

    .filter-shell {
        border: 1px solid var(--color-border-light);
        border-radius: var(--radius-md);
        background: var(--color-surface-secondary);
    }

    .split-list-pane,
    .split-detail-pane {
        border: 1px solid var(--color-border-light);
        border-radius: var(--radius-md);
        background: var(--color-surface);
    }

    .split-list-pane {
        max-height: 70vh;
        overflow-y: auto;
    }

    .record-card-list {
        display: grid;
        gap: var(--space-xs);
    }

    .record-card {
        border: 1px solid var(--color-border-light);
        border-radius: var(--radius-md);
        padding: var(--space-sm);
        background: var(--color-surface);
    }

        .record-card.active {
            background: color-mix(in srgb, var(--color-primary) 8%, white);
            border-color: color-mix(in srgb, var(--color-primary) 38%, var(--color-border-light));
        }

    .responsive-form-section {
        border: 1px solid var(--color-border-light);
        border-radius: var(--radius-md);
        background: var(--color-surface);
    }

    .mobile-sticky-actions {
        position: sticky;
        /*bottom: calc(var(--mobile-bottom-nav-height) + var(--space-sm));*/
        z-index: 15;
        background: var(--color-surface);
        border: 1px solid var(--color-border-light);
        border-radius: var(--radius-md);
        padding: var(--space-sm);
    }

    .rm-mobile-form-actions {
        display: none;
    }

    .rm-mobile-form-actions-spacer {
        display: none;
    }

    @media (max-width: 767.98px) {
        .rm-mobile-form-actions {
            position: fixed;
            left: 0;
            right: 0;
            bottom: calc(var(--mobile-bottom-nav-height) + env(safe-area-inset-bottom, 0));
            z-index: 10020;
            display: flex;
            gap: 0.5rem;
            justify-content: flex-end;
            padding: 0.6rem 0.75rem;
            background: rgba(255, 255, 255, 0.98);
            border-top: 1px solid #e9ecef;
            box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.08);
        }

            .rm-mobile-form-actions .btn {
                min-height: 40px;
                min-width: 110px;
            }

        .rm-mobile-form-actions-spacer {
            display: block;
            /* Reserve content space for the fixed mobile action bar so form footer is never hidden. */
            height: 72px;
        }
    }
    /* Reusable stat card visuals used in dashboard/sales */
    .dashboard-stat-card {
        transition: transform var(--transition-normal), box-shadow var(--transition-normal);
        cursor: pointer;
    }

        .dashboard-stat-card:hover {
            transform: translateY(-2px);
            box-shadow: var(--shadow-sm);
        }

    .dashboard-stat-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

        .dashboard-stat-icon .material-symbols-outlined {
            font-size: 24px;
        }

    .dashboard-stat-icon-primary {
        background: color-mix(in srgb, var(--color-primary) 14%, white);
        color: var(--color-primary);
    }

    .dashboard-stat-icon-success {
        background: color-mix(in srgb, var(--color-success) 14%, white);
        color: var(--color-success);
    }

    .dashboard-stat-icon-info {
        background: color-mix(in srgb, var(--color-info) 14%, white);
        color: var(--color-info);
    }

    .dashboard-stat-icon-warning {
        background: color-mix(in srgb, var(--color-warning) 14%, white);
        color: var(--color-warning);
    }

    @media (min-width: 768px) {
        .mobile-only {
            display: none !important;
            pointer-events: none !important;
        }

        .desktop-only {
            display: block !important;
        }
    }

    @media (max-width: 767.98px) {
        .module-shell {
            padding: var(--space-sm) !important;
        }

        .split-list-pane {
            max-height: unset;
        }

        /*.mobile-sticky-actions {
            bottom: calc(var(--mobile-bottom-nav-height) + var(--space-md));
        }*/

        .dashboard-stat-scroll {
            flex-wrap: nowrap;
            overflow-x: auto;
            margin-left: 0;
            margin-right: 0;
            padding-bottom: var(--space-xs);
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
        }

            .dashboard-stat-scroll::-webkit-scrollbar {
                display: none;
            }

        .dashboard-stat-col {
            flex: 0 0 47%;
            max-width: 82%;
            padding-left: 0;
            padding-right: var(--space-sm);
        }

        .settings-tab-panel {
            padding: var(--space-sm);
        }

        .profile-page-shell .mud-button {
            min-height: 36px;
        }

        .mobile-profile-btn {
            border-radius: 999px;
        }
    }
    /* ══════════════════════════════════════════════════════════
   STATUS BADGES
   ══════════════════════════════════════════════════════════ */
    .status-badge {
        display: inline-block;
        padding: 2px 8px;
        border-radius: 99px;
        font-size: 0.68rem;
        font-weight: 500;
        line-height: 1.5;
        white-space: nowrap;
    }

    .status-badge-paid {
        background: #e8f5e9;
        color: #2e7d32;
        border: 1px solid #a5d6a7
    }

    .status-badge-unpaid {
        background: #ffebee;
        color: #c62828;
        border: 1px solid #ef9a9a
    }

    .status-badge-partial {
        background: #fff8e1;
        color: #e65100;
        border: 1px solid #ffe082
    }

    .status-badge-returned {
        background: #ede7f6;
        color: #5e35b1;
        border: 1px solid #ce93d8
    }

    .status-badge-partial-returned {
        background: #f3e5f5;
        color: #7b1fa2;
        border: 1px solid #ce93d8
    }

    .status-badge-overdue {
        background: #fbe9e7;
        color: #bf360c;
        border: 1px solid #ffab91
    }

    .status-badge-draft {
        background: #f5f5f5;
        color: #616161;
        border: 1px solid #e0e0e0
    }

    .status-badge-cancelled {
        background: #eceff1;
        color: #455a64;
        border: 1px solid #b0bec5;
        text-decoration: line-through;
    }
    /* ══════════════════════════════════════════════════════════
   STATUS FILTER PILLS  (scrollable row at top of mobile list)
   ══════════════════════════════════════════════════════════ */
    .status-filter-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

        .status-filter-scroll::-webkit-scrollbar {
            display: none
        }

    .filter-tabs {
        flex-wrap: nowrap;
        gap: 4px;
        white-space: nowrap
    }

        .filter-tabs .nav-link {
            padding: 4px 14px;
            font-size: 0.75rem;
            border-radius: 99px;
            border: 1px solid #dee2e6;
            color: #6c757d;
            background: #fff;
            cursor: pointer;
            line-height: 1.4;
        }

            .filter-tabs .nav-link.active {
                background: var(--color-primary);
                border-color: var(--color-primary);
                color: #fff;
            }

            .filter-tabs .nav-link:hover:not(.active) {
                background: #f8f9fa
            }
    /* Invoice preview (mobile): slightly smaller pills than default filter-tabs */
    .invoice-preview-template-chips .filter-tabs .nav-link {
        padding: 3px 10px;
        font-size: 0.68rem;
        line-height: 1.35;
    }
    /* ══════════════════════════════════════════════════════════
   BOOTSTRAP UNDERLINE TABS  (detail panes)
   ══════════════════════════════════════════════════════════ */
    .detail-tabs {
        border-bottom: 1px solid #dee2e6;
        margin-bottom: 12px;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
    }

        .detail-tabs::-webkit-scrollbar {
            display: none
        }

        .detail-tabs .nav-link {
            font-size: 0.8rem;
            padding: 6px 14px;
            color: #6c757d;
            border: none;
            border-bottom: 2px solid transparent;
            border-radius: 0;
            background: none;
            cursor: pointer;
            white-space: nowrap;
        }

            .detail-tabs .nav-link.active {
                color: var(--color-primary);
                border-bottom-color: var(--color-primary);
                font-weight: 500;
            }

            .detail-tabs .nav-link:hover:not(.active) {
                color: #495057
            }
    /* Sales list / invoice detail: pill segment tabs (Details | Payments) */
    .sales-detail-tabs {
        display: inline-flex;
        flex-wrap: nowrap;
        gap: 4px;
        padding: 4px;
        background: #f1f3f5;
        border-radius: 999px;
        border: none;
        margin-bottom: 12px;
        max-width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
    }

        .sales-detail-tabs::-webkit-scrollbar {
            display: none
        }

        .sales-detail-tabs .nav-link {
            font-size: 0.8rem;
            padding: 6px 16px;
            border-radius: 999px;
            border: none;
            background: transparent;
            color: #6c757d;
            cursor: pointer;
            white-space: nowrap;
            line-height: 1.3;
        }

            .sales-detail-tabs .nav-link.active {
                background: #fff;
                color: var(--color-primary);
                font-weight: 600;
                box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
            }

            .sales-detail-tabs .nav-link:hover:not(.active) {
                color: #495057;
                background: rgba(255, 255, 255, 0.7);
            }
    /* Compact Home-style stats on sales detail (narrower than dashboard) */
    .sales-detail-mini-stats .sales-mini-stat {
        padding: 0.45rem 0.6rem;
        border-radius: var(--radius-md, 10px);
    }

    .sales-detail-mini-stats .stat-card-label {
        font-size: 0.62rem;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        color: #8a8a8a;
    }

    .sales-detail-mini-stats .stat-card-value {
        font-size: 1rem;
        font-weight: 700;
        line-height: 1.2;
    }

    .sales-detail-mini-stats .dashboard-stat-icon {
        width: 32px;
        height: 32px;
        border-radius: 10px;
        flex-shrink: 0;
    }

        .sales-detail-mini-stats .dashboard-stat-icon .material-symbols-outlined {
            font-size: 18px;
        }

    .sales-detail-mini-stats .sales-mini-stat-icon {
        width: 28px;
        height: 28px;
        border-radius: 8px;
    }

        .sales-detail-mini-stats .sales-mini-stat-icon .material-symbols-outlined {
            font-size: 16px;
        }
    /* Mud icon + label row (aligned with InvoicePreview mobile action bar) */
    .sales-invoice-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 10px 14px;
        align-items: flex-start;
        padding: 4px 0 8px;
        border-bottom: 1px solid #f0f0f0;
    }

    .sales-invoice-actions--mobile {
        justify-content: space-between;
        gap: 8px 6px;
    }

    .sales-action-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        min-width: 52px;
    }

    .sales-action-label {
        font-size: 0.62rem;
        color: #757575;
        margin-top: 2px;
        line-height: 1.2;
        text-align: center;
        max-width: 64px;
    }

    .sales-invoice-edit-btn {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 4px 6px !important;
        min-height: auto !important;
    }

        .sales-invoice-edit-btn:hover {
            background: rgba(0, 0, 0, 0.04) !important;
        }
    /* Sales form: fully paid checkbox density (label is separate MudText; checkbox only) */
    .sales-form-fully-paid .mud-button-root {
        padding: 4px;
    }
    /* Line items table: top-align so LINE TOTAL / tax stacks don’t sit lower than the row header */
    .sales-form-lines-table.mud-table-root td.mud-table-cell,
    .sales-form-lines-table.mud-table-root th.mud-table-head-cell {
        vertical-align: top;
    }
    /* ══════════════════════════════════════════════════════════
   SALES LIST — summary, filters, list/detail panes
   ══════════════════════════════════════════════════════════ */
    .sales-list-stat-card {
        padding: 0.45rem 0.6rem !important;
    }

        .sales-list-stat-card .stat-card-value {
            font-size: 1.15rem !important;
            margin-bottom: 0 !important;
        }

        .sales-list-stat-card .dashboard-stat-icon {
            width: 38px;
            height: 38px;
        }

            .sales-list-stat-card .dashboard-stat-icon .material-symbols-outlined {
                font-size: 22px;
            }

.sales-list-search-mobile {
  width: 100%;
  max-width: 100%;
}

/* Sales list: search + calendar button (aligned height with form-control-sm ~31px) */
.sales-list-date-filter-btn {
  width: 35px;
  height: 28px;
  padding-left: 0.35rem;
  padding-right: 0.35rem;
  border-radius: 8px;
}

@media (min-width: 768px) {
    .w-md-auto { width: auto !important; }
}

.sales-list-clear-all {
  color: #6c757d !important;
  line-height: 1;
}
.sales-list-clear-all:hover {
  color: var(--color-primary) !important;
}

/* Reusable compact summary row for filter context text/chips above tables */
.rm-filter-summary-row {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    background: #f8f9fa;
    padding: 0.3rem 0.5rem;
}

.rm-filter-summary-badge {
    font-weight: 500;
    font-size: 0.68rem;
}

.rm-filter-select-compact {
    font-size: 0.75rem;
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
}

/* Reports: shared bootstrap-first filter surface */
.rm-report-filter-shell {
    border: 1px solid #e8edf3;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfd 100%);
    padding: 0.6rem;
}

.rm-report-filter-shell .form-label {
    color: #5c6678;
    font-size: 0.72rem;
    font-weight: 600;
}

.rm-report-filter-shell .form-select,
.rm-report-filter-shell .form-control {
    border-radius: 9px;
    border-color: #d8e0eb;
}

.rm-report-filter-shell .form-select:focus,
.rm-report-filter-shell .form-control:focus {
    border-color: #9fc0ee;
    box-shadow: 0 0 0 0.18rem rgba(13, 110, 253, 0.12);
}

/* Reusable FAB popup menu */
.rm-fab-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: transparent;
    border: 0;
}

.rm-fab-menu {
    position: fixed;
    right: 5%;
    bottom: calc(15% + 54px);
    z-index: 1060;
    min-width: 150px;
    background: #fff;
    border: 0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transform-origin: bottom right;
    animation: rm-fab-menu-pop 140ms ease-out;
}

.rm-fab-menu--up {
    bottom: calc(15% + 54px);
}

.rm-fab-menu-item {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: #fff;
    color: #334155;
    padding: 8px 10px;
    font-size: 0.82rem;
    text-align: left;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    text-decoration: none;
}

.rm-fab-menu-item:hover {
    background: #f1f5f9;
}

.rm-fab-menu-item-icon {
    font-size: 18px;
    color: #64748b;
}

.rm-fab-menu .mud-button-root {
    justify-content: flex-start !important;
    text-transform: none;
    min-width: 0;
    box-shadow: none;
    text-align: left;
}

.rm-fab-menu-item-icon--primary {
    color: var(--color-primary);
}

.rm-fab-menu-item-icon--success {
    color: var(--color-success);
}

.rm-fab-menu-item-icon--warning {
    color: var(--color-warning);
}

@keyframes rm-fab-menu-pop {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Desktop: chips column sits beside search; keep pills on one line when possible */
@media (min-width: 768px) {
  .sales-list-payment-chips--row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: 31px;
  }

    .rm-fab-backdrop,
    .rm-fab-menu,
    .rm-fab-stack,
    .rm-fab,
    .mobile-fixed-button {
        display: none !important;
    }
}
    /* One chip row: compact on phone, larger pills on desktop */
    .sales-list-payment-chips .filter-tabs .nav-link {
        padding: 6px 12px;
        font-size: 0.72rem;
    }

    @media (min-width: 768px) {
        .sales-list-payment-chips .filter-tabs .nav-link {
            padding: 6.5px 18px;
            font-size: 0.88rem;
        }
    }

.sales-list-item-active {
    background: #f1f3f5;
    border-color: var(--border-color);
}

    .sales-invoice-actions--header {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
        gap: 0;
        margin-bottom: 0 !important;
    }

    .sales-list-mobile-row-edit {
        line-height: 1;
        min-width: auto;
    }

    /* Transparent full-screen backdrop behind overflow menu to close on outside tap */
    .rm-overflow-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 10029;
        background: transparent;
    }

    .rm-overflow-menu {
        display: flex;
        align-items: center;
    }

    .rm-overflow-menu-toggle {
        line-height: 1;
        min-width: auto;
        color: #5f6368;
        text-decoration: none;
    }

        .rm-overflow-menu-toggle .material-symbols-outlined {
            font-size: 20px;
        }

    .rm-overflow-menu-panel {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        bottom: 0;
        transform: none !important;
        margin: 0 !important;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        box-shadow: 0 -10px 32px rgba(15, 23, 42, 0.2);
        background: #fff;
        z-index: 10030;
        padding: 0 0 env(safe-area-inset-bottom, 12px);
        max-height: 60vh;
        overflow-y: auto;
    }

    .rm-overflow-menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px 10px;
        border-bottom: 1px solid #f0f0f0;
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--color-text-secondary);
        letter-spacing: 0.02em;
    }

    .rm-overflow-menu-close {
        color: var(--color-text-secondary);
        line-height: 1;
    }
.modal{
    z-index:10055 !important;
}
.rm-overflow-menu-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px 2px;
    padding: 10px 8px 14px;
}

    .rm-overflow-menu-action {
        border: none;
        background: none;
        border-radius: var(--radius-md, 8px);
        padding: 8px 2px 6px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        text-decoration: none;
        color: var(--color-text-primary);
        font-size: 0.68rem;
        font-weight: 500;
        text-align: center;
        line-height: 1.25;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        width: 100%;
    }

        .rm-overflow-menu-action:hover, .rm-overflow-menu-action:active {
            background: var(--color-surface-secondary, #f5f5f5);
        }

    .rm-overflow-menu-action-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

        .rm-overflow-menu-action-icon .material-symbols-outlined {
            font-size: 22px;
        }

    .rm-overflow-menu-action-icon--primary {
        background: color-mix(in srgb, var(--color-primary) 16%, white);
        color: var(--color-primary);
    }

    .rm-overflow-menu-action-icon--info {
        background: color-mix(in srgb, #0288d1 16%, white);
        color: #0288d1;
    }

    .rm-overflow-menu-action-icon--success {
        background: color-mix(in srgb, var(--color-success) 16%, white);
        color: var(--color-success);
    }

    .rm-overflow-menu-action-icon--warning {
        background: color-mix(in srgb, var(--color-warning) 18%, white);
        color: var(--color-warning);
    }

    .rm-overflow-menu-action-icon--danger {
        background: color-mix(in srgb, var(--color-danger) 16%, white);
        color: var(--color-danger);
    }

    .sales-mobile-header-edit {
        padding: 6px 10px !important;
        border-radius: 8px !important;
        line-height: 1;
    }

    .rm-mobile-detail-overlay {
        z-index: 10020;
        background: #f8fafc;
        /* Override base .mobile-search-overlay padding. Use injected --safe-area-inset-*
           variables (set by MAUI native) so content never hides behind status or nav bars. */
        padding: var(--safe-area-inset-top, env(safe-area-inset-top, 0px)) 0 var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)) !important;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    /* The sticky header inside the overlay must never grow beyond 55% of the viewport —
       if it does the scrollable content area is squeezed to nothing on small phones.
       overflow-y:auto lets it scroll internally when content is taller than the cap. */
    .rm-mobile-detail-overlay > .mobile-detail-header {
        flex-shrink: 0;
        max-height: 55vh;
        overflow-y: scroll; /* scroll is more reliable than auto in MAUI Android WebView */
    }

    .rm-mobile-detail-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: scroll; /* 'scroll' is more reliable than 'auto' in MAUI Android WebView */
        -webkit-overflow-scrolling: touch;
        /* contain prevents scroll chaining to parent page.
           Do NOT set overscroll-behavior-y:none — that also blocks scrolling UP in the container. */
        overscroll-behavior: contain;
        touch-action: pan-y;
        /* Hide the persistent scrollbar gutter; thumb shows only while scrolling (WebKit) */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* old Edge */
    }

    /* WebKit/Chromium (MAUI Android & Windows WebView): overlay-style thin scrollbar.
       A transparent track + faint thumb reads as "no fixed scrollbar" but still drags. */
    .rm-mobile-detail-content::-webkit-scrollbar {
        width: 0px;
        background: transparent;
    }

    .rm-mobile-detail-content::-webkit-scrollbar-thumb {
        background: transparent;
    }

    .sales-mobile-invoice-detail-card {
        background: linear-gradient(180deg, #f8f9fb 0%, #ffffff 55%);
        border: 1px solid #e3e6ea !important;
        border-radius: 10px;
    }

    .sales-mobile-detail-grid .detail-label {
        font-weight: 600;
        color: #6c757d;
    }

    .sales-mobile-detail-grid .detail-value {
        font-weight: 500;
    }

    .sales-mobile-detail-grid .detail-grid-customer-cell {
        grid-column: 1 / -1;
    }

    /* ── Header action buttons: icon above label (like bottom-nav More menu) ── */
    .sales-mobile-header-actions {
        gap: 0.15rem;
    }

    .sales-mobile-action-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1px;
        min-width: 48px;
        padding: 0.25rem 0.35rem;
        background: none;
        border: none;
        border-radius: 10px;
        cursor: pointer;
        line-height: 1;
    }

    .sales-mobile-action-btn:active {
        background: rgba(0, 0, 0, 0.05);
    }

    .sales-mobile-action-btn .material-symbols-outlined {
        font-size: 22px;
    }

    .sales-mobile-action-label {
        font-size: 0.65rem;
        font-weight: 600;
    }

    /* ── Card-based mobile sale detail (Billed To / Items / Payment History) ── */
    .sales-mobile-section-card {
        border: 1px solid #e7ebf0 !important;
        border-radius: 14px;
        box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06) !important;
    }

.sales-mobile-card-heading {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #6c757d;
}

    .sales-mobile-card-heading .material-symbols-outlined {
        font-size: 20px;
        color: var(--color-primary, #d32f2f);
    }

    .sales-mobile-party-name {
        font-size: 0.95rem;
        font-weight: 700;
        color: #111827 !important;
    }

    /* Header party name that wraps to a second line but stays within its block */
    .sales-mobile-party-name-wrap {
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
        line-height: 1.2;
    }

    /* Aging-bucket colour dot */
    .sales-mobile-aging-dot {
        display: inline-block;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        flex-shrink: 0;
        margin-right: 6px;
        vertical-align: middle;
    }

    /* ── Label-left / value-right detail rows (shared redesign primitive) ── */
    .detail-row {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 12px;
        padding: 0.5rem 0;
        border-bottom: 1px solid #f1f3f6;
    }

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

.detail-row-label {
    font-size: 0.75rem;
    color: #4b515d;
    flex-shrink: 0;
    text-transform: uppercase;
    font-weight: 600;
}

.detail-row-value {
    font-size: 0.77rem;
    font-weight: 500;
    color: #374151;
    text-align: right;
    overflow-wrap: anywhere;
}

    /* Aging sub-section inside Profile — lighter, smaller variant */
    .detail-row--aging .detail-row-label {
        font-weight: 600;
    }

    .detail-row--aging .detail-row-value {
        font-weight: 600;
        font-size: 0.78rem;
    }

    .detail-row-value--mono {
        font-weight: 500;
        letter-spacing: -0.01em;
    }

    /* Credit-limit hero (parties) */
    .credit-hero-amount {
        font-size: 1.5rem;
        font-weight: 700;
        line-height: 1.1;
    }

    .credit-hero-bar {
        height: 8px;
        background: #eef1f4;
        border-radius: 6px;
        overflow: hidden;
        margin: 0.5rem 0;
    }

    .credit-hero-bar-fill {
        height: 100%;
        border-radius: 6px;
    }

    /* Big stock number hero (products) */
    .stock-hero-qty {
        font-size: 1.65rem;
        font-weight: 700;
        line-height: 1;
    }

    .sales-mobile-party-meta {
        font-size: 0.75rem;
        color: #6b7280;
        margin-top: 1px;
    }

    .sales-mobile-party-gstin {
        font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    }

    .sales-mobile-party-dot {
        margin: 0 0.3rem;
        color: #c5cad1;
    }

    .sales-mobile-party-footer {
        display: flex;
        align-items: center;
        font-size: 0.75rem;
        color: #6b7280;
    }

    .sales-mobile-party-footer .material-symbols-outlined {
        font-size: 16px;
        margin-right: 0.3rem;
        color: #9aa1ab;
    }

    /* Items + payments rows */
    .sales-mobile-item-row,
    .sales-mobile-payment-row {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.55rem 0;
        border-bottom: 1px solid #f1f3f6;
    }

    .sales-mobile-item-row:last-child,
    .sales-mobile-payment-row:last-child {
        border-bottom: 0;
    }

    .sales-mobile-item-name {
        font-size: 0.875rem;
        font-weight: 600;
        color: #111827;
    }

    .sales-mobile-item-meta {
        font-size: 0.75rem;
        color: #6b7280;
        margin-top: 1px;
        display: flex;
        align-items: center;
        flex-wrap: wrap;
    }

    .sales-mobile-item-amount {
        font-size: 0.9rem;
        font-weight: 700;
        color: #111827;
        white-space: nowrap;
    }

    .sales-mobile-payment-amount {
        font-size: 0.9rem;
        font-weight: 700;
        color: #2e7d32;
        white-space: nowrap;
    }

    /* Totals block inside Items card */
    .sales-mobile-totals {
        border-top: 1px solid #eceff3;
        font-size: 0.8rem;
    }

    .sales-mobile-totals > div {
        padding: 2px 0;
    }

    .sales-mobile-grand-total {
        border-top: 1px solid #e1e5ea;
        margin-top: 0.35rem;
        padding-top: 0.45rem !important;
        font-size: 0.95rem;
        font-weight: 700;
    }

    /* Mobile invoice overlay: slightly tighter metric cards */
    .mobile-search-overlay .sales-detail-mini-stats .sales-mini-stat {
        padding: 0.75rem 0.55rem !important;
    }
.mud-icon-size-medium{
    font-size:1.75rem !important;
}
.mud-icon-button {
    padding: 8px !important;
}
.mobile-search-overlay .sales-detail-mini-stats .stat-card-value {
    font-size: 0.8rem !important;
}

.rm-mobile-detail-header--sales {
    background: linear-gradient(140deg, #fff5f5 0%, #ffffff 45%, #f8fbff 100%);
    border-bottom: 1px solid #e9eef5;
}

.rm-mobile-sales-overlay .sales-detail-tabs {
    position: sticky;
    top: 0;
    z-index: 4;
    background: #fff;
    padding-top: 0.15rem;
    margin-bottom: 0.65rem;
}

.rm-mobile-sales-overlay .sales-mobile-invoice-detail-card {
    border-radius: 14px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08) !important;
    border-color: #dce4ee !important;
}

.rm-mobile-sales-overlay .sales-invoice-actions--mobile {
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 12px;
    padding: 0.45rem 0.35rem 0.15rem;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
}

@media (max-width: 767.98px) {
        .mud-xs-table .mud-table-cell:before {
            content: none !important;
        }

            .rm-mobile-detail-content {
                /* Flat value avoids relying on CSS max() or env(), neither of which
           is reliable on Android WebView API 24-28 (MAUI minimum target).
           100px clears the tallest Android navigation bar on any device. */
                padding-bottom: 100px !important;
            }
        }

        /* ══════════════════════════════════════════════════════════
   DETAIL ACTION BUTTONS ROW
   ══════════════════════════════════════════════════════════ */
        .detail-action-row {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            padding: 6px 0 4px;
        }

        .detail-action-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
            padding: 6px 10px;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            background: #fff;
            cursor: pointer;
            font-size: 0.65rem;
            color: #495057;
            min-width: 50px;
            text-decoration: none;
            transition: background 0.15s, border-color 0.15s;
        }

            .detail-action-btn:hover {
                background: #f5f5f5;
                border-color: #bdbdbd
            }

            .detail-action-btn .material-symbols-outlined {
                font-size: 18px
            }

            .detail-action-btn.btn-danger {
                color: #c62828
            }

            .detail-action-btn.btn-success {
                color: #2e7d32
            }

            .detail-action-btn.btn-primary {
                color: var(--color-primary)
            }

            .detail-action-btn.btn-info {
                color: #0288d1
            }

            .detail-action-btn.btn-warning {
                color: #e65100
            }
        /* ══════════════════════════════════════════════════════════
   FINANCIAL SUMMARY BOXES  (Total / Paid / Due strip)
   ══════════════════════════════════════════════════════════ */
        .detail-fin-row {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            margin-bottom: 12px;
        }

        .detail-fin-box {
            padding: 8px 10px;
            border-radius: 8px;
            border: 1px solid #e0e0e0;
            background: #fafafa;
        }

            .detail-fin-box .fin-label {
                font-size: 0.68rem;
                color: #9e9e9e;
                margin-bottom: 2px
            }

            .detail-fin-box .fin-value {
                font-size: 0.95rem;
                font-weight: 600;
                color: #333
            }

            .detail-fin-box.fin-primary .fin-value {
                color: var(--color-primary)
            }

            .detail-fin-box.fin-success .fin-value {
                color: #2e7d32
            }

            .detail-fin-box.fin-danger .fin-value {
                color: #c62828
            }
        /* ══════════════════════════════════════════════════════════
   MOBILE DETAIL OVERLAY IMPROVEMENTS
   ══════════════════════════════════════════════════════════ */
        .mobile-detail-header {
            position: sticky;
            top: 0;
            z-index: 2;
            background: #fff;
            padding: 9px 5px 0;
            border-bottom: 1px solid #f0f0f0;
        }

        .mobile-detail-header-top {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            margin-bottom: 8px;
        }

        .mobile-detail-back-btn {
            background: none;
            border: none;
            padding: 2px;
            cursor: pointer;
            color: #616161;
            display: flex;
            align-items: center;
            flex-shrink: 0;
            margin-top: 2px;
        }

        .mobile-detail-title {
            font-size: 1rem;
            font-weight: 600;
            line-height: 1.2;
        }

        .mobile-detail-subtitle {
            font-size: 0.75rem;
            color: #757575;
            margin-top: 2px;
        }
        /* ══════════════════════════════════════════════════════════
   PARTY AVATAR  (initials circle — Customers page)
   ══════════════════════════════════════════════════════════ */
        .party-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.78rem;
            font-weight: 600;
            color: #fff;
            flex-shrink: 0;
            user-select: none;
        }

        /* ============================================================
   RETAIL MANAGEMENT GLOBAL RESPONSIVE TABLE AND TOOLBAR SYSTEM
   Single markup: table on desktop, card-rows on mobile
   ============================================================ */
        .rm-table-toolbar {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            align-items: center;
            margin-bottom: 0.5rem;
        }

            .rm-table-toolbar .rm-toolbar-search {
                flex: 1 1 16rem;
                min-width: 0;
            }

            .rm-table-toolbar .rm-toolbar-actions {
                display: flex;
                flex-wrap: wrap;
                gap: 0.5rem;
                align-items: center;
            }

        .rm-chip-row {
            display: flex;
            flex-wrap: wrap;
            gap: 0.375rem;
            margin-bottom: 0.5rem;
        }

            .rm-chip-row.rm-chip-row-scroll {
                flex-wrap: nowrap;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: none;
                padding-bottom: 2px;
            }

                .rm-chip-row.rm-chip-row-scroll::-webkit-scrollbar {
                    display: none;
                }

        .rm-chip {
            border: 1px solid #d7dce2;
            border-radius: 999px;
            padding: 0.22rem 0.6rem;
            font-size: 0.73rem;
            background: #fff;
            color: #4f5a68;
            line-height: 1.3;
            white-space: nowrap;
        }

            .rm-chip.rm-chip-active {
                background: var(--color-primary);
                color: #fff;
                border-color: var(--color-primary);
            }

        /* ============================================================
   TAX INVOICE FORM - DROPDOWN OVERFLOW FIX
   Ensures item search dropdown is visible above add-row button
   ============================================================ */

        /* For desktop table rows with item search dropdowns */
        .tax-inv-desktop-lines table tbody tr {
            position: relative;
            z-index: 0;
        }

            .tax-inv-desktop-lines table tbody tr:has(.tax-inv-search-wrap:focus-within) {
                z-index: 50;
            }

        /* For mobile line cards with item search dropdowns */
        .tax-inv-mobile-line-card {
            position: relative;
            z-index: 0;
        }

            .tax-inv-mobile-line-card:has(.tax-inv-search-wrap:focus-within) {
                z-index: 50;
            }

        /* Ensure dropdown container allows visibility */
        .tax-inv-search-wrap {
            position: relative;
        }

            /* Make dropdown appear above all sibling content */
            .tax-inv-search-wrap:focus-within .tax-inv-dropdown {
                z-index: 1050;
            }

        /* Allow table and mobile container to overflow for dropdown */
        .tax-inv-desktop-lines {
            overflow: visible !important;
        }

        .tax-inv-mobile-lines,
        .tax-inv-mobile-lines-wrap {
            overflow: visible !important;
        }

        .rm-table-container {
            border: 1px solid #e6e9ee;
            border-radius: 12px;
            background: #fff;
            overflow: hidden;
        }

        .rm-table-loading {
            padding: 0.75rem;
        }

        .rm-table-empty {
            text-align: center;
            padding: 2rem 1rem;
            color: #6c757d;
        }

        .rm-table {
            width: 100%;
            margin: 0;
            border-collapse: separate;
            border-spacing: 0;
        }

            .rm-table thead th {
                background: #f7f9fc;
                color: #5e6978;
                font-size: 0.76rem;
                font-weight: 600;
                text-transform: uppercase;
                letter-spacing: 0.02em;
                border-bottom: 1px solid #e6e9ee;
                padding: 0.58rem 0.62rem;
                white-space: nowrap;
            }

            .rm-table tbody td {
                border-bottom: 1px solid #edf0f4;
                padding: 0.58rem 0.62rem;
                vertical-align: middle;
                font-size: 0.85rem;
            }

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

        .rm-cell-title {
            font-weight: 600;
            color: #1f2b3d;
        }

        .rm-cell-subtitle {
            color: #6f7b8a;
            font-size: 0.75rem;
        }

        .rm-cell-muted {
            color: #6f7b8a;
        }

        .rm-cell-amount {
            font-weight: 600;
            text-align: right;
        }

        .rm-cell-status {
            display: inline-flex;
        }

        .rm-cell-actions {
            white-space: nowrap;
        }

        .rm-row-actions {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
        }

        /* Mobile transformation to SalesList-style compact cards with multiple fields */
        @media (max-width: 767.98px) {
            .rm-table-toolbar {
                align-items: stretch;
            }

                .rm-table-toolbar .rm-toolbar-search {
                    flex-basis: 100%;
                }

                .rm-table-toolbar .rm-toolbar-actions {
                    width: 100%;
                }

            .rm-table--mobile-card thead {
                display: none;
            }

            .rm-table--mobile-card,
            .rm-table--mobile-card tbody,
            .rm-table--mobile-card tr,
            .rm-table--mobile-card td {
                display: block;
                width: 100%;
            }

                .rm-table--mobile-card tbody {
                    padding: 0.35rem;
                }

                    .rm-table--mobile-card tbody tr {
                        border: 1px solid #e5e8ee;
                        border-radius: 10px;
                        background: #fff;
                        margin-bottom: 0.42rem;
                        padding: 0.52rem 0.58rem;
                    }

                        .rm-table--mobile-card tbody tr:last-child {
                            margin-bottom: 0;
                        }

                    .rm-table--mobile-card tbody td {
                        border: none !important;
                        padding: 0;
                        font-size: 0.8rem;
                        line-height: 1.4;
                    }

                .rm-table--mobile-card td::before {
                    content: attr(data-label);
                    display: block;
                    color: #7b8797;
                    font-size: 0.68rem;
                    text-transform: uppercase;
                    letter-spacing: 0.03em;
                    margin-bottom: 2px;
                }

                .rm-table--mobile-card td.rm-cell-primary::before {
                    display: none;
                }

                .rm-table--mobile-card td.rm-cell-primary {
                    margin-bottom: 0.28rem;
                }

                    .rm-table--mobile-card td.rm-cell-primary .rm-cell-title {
                        font-size: 0.86rem;
                    }

                .rm-table--mobile-card td + td {
                    margin-top: 0.26rem;
                }

                .rm-table--mobile-card td.rm-cell-actions {
                    margin-top: 0.45rem;
                }

                .rm-table--mobile-card td.rm-cell-amount {
                    text-align: left;
                }

            .rm-table--accounts.rm-table--mobile-card tbody tr {
                display: grid;
                grid-template-columns: minmax(0, 1fr) auto;
                gap: 0.2rem 0.5rem;
                align-items: start;
                padding: 0.6rem 0.62rem;
            }

            .rm-table--accounts.rm-table--mobile-card td {
                margin-top: 0 !important;
            }

                .rm-table--accounts.rm-table--mobile-card td::before {
                    margin-bottom: 1px;
                }

            /* Status chips must hug their text inside mobile-card / grid cells — a block/grid cell would
               otherwise let a stretched child fill the full row width. Force content-width + left align. */
            .rm-table--mobile-card td .status-badge {
                display: inline-block;
                width: auto;
                max-width: max-content;
                justify-self: start;
            }

            .rm-table--accounts.rm-table--mobile-card .rm-cell-primary {
                grid-column: 1;
                grid-row: 1;
            }

            .rm-table--accounts.rm-table--mobile-card .rm-cell-name {
                grid-column: 1 / -1;
                grid-row: 2;
                font-weight: 500;
            }

                .rm-table--accounts.rm-table--mobile-card .rm-cell-name::before,
                .rm-table--accounts.rm-table--mobile-card .rm-cell-status::before {
                    display: none;
                }

            .rm-table--accounts.rm-table--mobile-card .rm-cell-type {
                grid-column: 1;
                grid-row: 3;
            }

            .rm-table--accounts.rm-table--mobile-card .rm-cell-parent {
                grid-column: 2;
                grid-row: 3;
                text-align: right;
            }

            .rm-table--accounts.rm-table--mobile-card .rm-cell-opening {
                grid-column: 1;
                grid-row: 4;
            }

            .rm-table--accounts.rm-table--mobile-card .rm-cell-status {
                grid-column: 2;
                grid-row: 4;
                justify-content: flex-end;
                align-self: end;
            }

            .rm-table--accounts.rm-table--mobile-card .rm-cell-actions {
                grid-column: 1 / -1;
                grid-row: 5;
            }

                .rm-table--accounts.rm-table--mobile-card .rm-cell-actions .d-flex {
                    gap: 0.35rem !important;
                }

            .rm-table--accounts.rm-table--mobile-card .rm-row-actions {
                display: flex;
                justify-content: flex-start;
            }
        }

        /* Products page: native-like actions and filter ergonomics */
        .products-header-shell {
            align-items: flex-start !important;
        }

        .products-header-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 0.45rem;
            justify-content: flex-end;
        }

        .products-secondary-action {
            border-radius: 999px !important;
        }

        .products-primary-action {
            border-radius: 999px !important;
            white-space: nowrap;
        }

        .products-filter-shell {
            border: 1px solid #e7eaf0;
            border-radius: 12px;
            background: #fff;
        }

        .products-category-select {
            min-width: 12rem;
        }

        .products-low-stock-switch {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            min-height: 2rem;
        }

            .products-low-stock-switch .form-check-input {
                margin-top: 0;
            }

            .products-low-stock-switch .form-check-label {
                font-size: 0.86rem;
                color: #49566a;
            }

        .products-type-chips .rm-chip {
            min-height: 2rem;
            padding-inline: 0.9rem;
        }

        @media (max-width: 767.98px) {
            .products-header-shell {
                flex-direction: column;
                align-items: stretch !important;
                gap: 0.45rem;
            }

            .products-header-actions {
                width: 100%;
                justify-content: flex-start;
                flex-wrap: wrap;
                overflow: visible;
                padding-bottom: 0;
                gap: 0.4rem;
            }

                .products-header-actions::-webkit-scrollbar {
                    display: none;
                }

                .products-header-actions .btn {
                    white-space: nowrap;
                    font-size: 0.88rem;
                    min-height: 38px;
                    padding-inline: 0.9rem;
                }

            .products-primary-action {
                margin-left: auto;
            }

            .products-filter-shell {
                padding: 0.55rem !important;
                border-radius: 10px;
            }

            .products-category-select {
                min-width: 0;
                width: 100%;
            }

            .products-low-stock-switch {
                width: 100%;
            }

            .products-type-chips {
                margin-bottom: 0.2rem;
            }
        }

        /* ── Mandatory update full-screen overlay ─────────────────────────────────────
   Un-bypassable: fixed, full-viewport, above everything (incl. bottom nav / MudBlazor
   overlays), and intercepts all pointer events so nothing behind it is clickable. */
        .mandatory-update-overlay {
            position: fixed;
            inset: 0;
            z-index: 20000; /* above MudBlazor dialogs (1300s) and the mobile bottom nav */
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1.25rem;
            background: rgba(248, 249, 250, 0.97);
            backdrop-filter: blur(2px);
        }

        .mandatory-update-card {
            width: 100%;
            max-width: 420px;
            background: #fff;
            border: 1px solid var(--bs-border-color, #dee2e6);
            border-radius: 0.75rem;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
            padding: 2rem 1.5rem;
            text-align: center;
        }

        .mandatory-update-logo {
            height: 56px;
            object-fit: contain;
            margin-bottom: 1rem;
        }
