
/* New Saudi Riyal currency symbol — renders U+20C0 (official new sign, sits to the
   LEFT of the number) and U+FDFC (﷼) with the official glyph. Because of unicode-range,
   this font is used ONLY for the Riyal symbol; all other text keeps its normal font.
   Currency display is normalized to U+20C0 so the symbol appears left of the amount everywhere. */
@font-face {
    font-family: "SaudiRiyalSymbol";
    src: url("assets/fonts/SaudiRiyalFont.ttf?v=20c0") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    unicode-range: U+20C0, U+FDFC;
}

:root {
    --app-font-family: "SaudiRiyalSymbol", "Cairo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --primary-rgb: 28, 75, 115;
    --primary-color: #1c4b73;

    /* Global ERP design tokens (shared by all pages + dashboard) */
    --ed-primary: var(--primary-color);
    --ed-bg: #f3f6f8;
    --ed-surface: #ffffff;
    --ed-surface-muted: #f8fafc;
    --ed-border: #dce4ea;
    --ed-text: #14283b;
    --ed-muted: #617286;
    --ed-primary-soft: rgba(var(--primary-rgb), 0.1);
    --ed-success: #0f766e;
    --ed-success-soft: rgba(15, 118, 110, 0.1);
    --ed-danger: #c2410c;
    --ed-danger-soft: rgba(194, 65, 12, 0.1);
    --ed-warning: #b45309;
    --ed-warning-soft: rgba(180, 83, 9, 0.1);
    --ed-info: #0369a1;
    --ed-info-soft: rgba(3, 105, 161, 0.1);
    --ed-accent: #94671f;
    --ed-accent-soft: rgba(148, 103, 31, 0.12);
    --ed-radius: 12px;
    --ed-radius-lg: 16px;
    --ed-shadow: 0 1px 2px rgba(15, 35, 52, 0.04), 0 10px 28px rgba(15, 35, 52, 0.055);
    --ed-shadow-hover: 0 5px 14px rgba(15, 35, 52, 0.08), 0 16px 34px rgba(var(--primary-rgb), 0.09);
    --ed-gap: 1.25rem;
    --ed-pad: 1.25rem;
}

/* One accent source for every legacy theme option.  The visual system below
   consumes these variables, so changing the colour in Settings now updates
   cards, focus rings, buttons, navigation and tables consistently. */
[data-color="primary"] {
    --primary-rgb: 28, 75, 115;
    --primary-color: #1c4b73;
}

[data-color="brightblue"] {
    --primary-rgb: 15, 118, 110;
    --primary-color: #0f766e;
}

[data-color="lunargreen"] {
    --primary-rgb: 190, 63, 68;
    --primary-color: #be3f44;
}

[data-color="lavendar"] {
    --primary-rgb: 100, 82, 163;
    --primary-color: #6452a3;
}

[data-color="magenta"] {
    --primary-rgb: 174, 59, 105;
    --primary-color: #ae3b69;
}

[data-color="chromeyellow"] {
    --primary-rgb: 148, 103, 31;
    --primary-color: #94671f;
}

[data-color="orange"] {
    --primary-rgb: 190, 88, 35;
    --primary-color: #be5823;
}

[data-theme="professional"] {
    --ed-bg: #eef2f1;
    --ed-surface: #ffffff;
    --ed-surface-muted: #f8faf9;
    --ed-border: #d7e0dd;
    --ed-text: #10231f;
    --ed-muted: #5b6f6a;
}

[data-theme="dark"] {
    --ed-bg: #0f1419;
    --ed-surface: #1a222c;
    --ed-surface-muted: #151c25;
    --ed-border: #2a3441;
    --ed-text: #e8eef5;
    --ed-muted: #94a3b8;
    --ed-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 10px 24px rgba(0, 0, 0, 0.2);
    --ed-shadow-hover: 0 4px 14px rgba(0, 0, 0, 0.35);
}

[data-density="compact"] {
    --ed-gap: 0.85rem;
    --ed-pad: 0.9rem;
    --ed-radius: 10px;
    --ed-radius-lg: 12px;
}

[data-card="outline"] {
    --ed-shadow: none;
    --ed-shadow-hover: none;
}

[data-card="flat"] {
    --ed-shadow: none;
    --ed-shadow-hover: none;
}

body,
button,
input,
select,
textarea {
    font-family: var(--app-font-family) !important;
}

/* Theme rules set a different font (e.g. Nunito) on tables/headings, which dropped
   "SaudiRiyalSymbol" from their stack so the Riyal sign fell back to a wrong glyph.
   Re-add it as the FIRST font here; unicode-range keeps it limited to the symbol only,
   so normal text still renders in the theme font. */
td, th,
h1, h2, h3, h4, h5, h6,
p, b, strong, label, small,
.badge, .fw-bold, .fw-semibold, .fw-medium, .amount, .price {
    font-family: "SaudiRiyalSymbol", "Nunito", "Cairo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif !important;
}

/* Date-range pickers must stay left-to-right so the "start - end" order is not
   bidi-reversed under RTL (otherwise the end date appears before the start date,
   e.g. "2026-06-09 - 2026-06-02"). Applies to the dashboard picker (#daterange),
   the booking-range widgets, and the daterangepicker dropdown calendar. */
#daterange,
input.custom-date,
input.date-range,
input[name="datetimes"],
.bookingrange span,
.daterangepicker {
    direction: ltr !important;
    unicode-bidi: isolate;
}
#daterange,
input.custom-date {
    text-align: center;
}

/* Keep the calendar button on the left of LTR date ranges inside Arabic pages. */
.input-group:has(> .input-group-text + #daterange) {
    direction: ltr !important;
}

input[type="date"],
input[type="datetime-local"],
input[type="month"],
input[type="time"] {
    direction: ltr !important;
    unicode-bidi: isolate;
    text-align: left;
}

/* Bootstrap's me/ms utilities are physical left/right margins. Mirror them so
   icons and labels keep their intended logical spacing in Arabic layouts. */
body.layout-mode-rtl .me-0 { margin-right: 0 !important; margin-left: 0 !important; }
body.layout-mode-rtl .me-1 { margin-right: 0 !important; margin-left: .25rem !important; }
body.layout-mode-rtl .me-2 { margin-right: 0 !important; margin-left: .5rem !important; }
body.layout-mode-rtl .me-3 { margin-right: 0 !important; margin-left: 1rem !important; }
body.layout-mode-rtl .me-4 { margin-right: 0 !important; margin-left: 1.5rem !important; }
body.layout-mode-rtl .me-5 { margin-right: 0 !important; margin-left: 3rem !important; }
body.layout-mode-rtl .me-auto { margin-right: 0 !important; margin-left: auto !important; }
body.layout-mode-rtl .ms-0 { margin-left: 0 !important; margin-right: 0 !important; }
body.layout-mode-rtl .ms-1 { margin-left: 0 !important; margin-right: .25rem !important; }
body.layout-mode-rtl .ms-2 { margin-left: 0 !important; margin-right: .5rem !important; }
body.layout-mode-rtl .ms-3 { margin-left: 0 !important; margin-right: 1rem !important; }
body.layout-mode-rtl .ms-4 { margin-left: 0 !important; margin-right: 1.5rem !important; }
body.layout-mode-rtl .ms-5 { margin-left: 0 !important; margin-right: 3rem !important; }
body.layout-mode-rtl .ms-auto { margin-left: 0 !important; margin-right: auto !important; }

body.layout-mode-rtl :is(.btn, button, a, h1, h2, h3, h4, h5, h6, label) > i {
    vertical-align: middle;
    line-height: 1;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}
.d-none {
    display: none;
}


/* Screen preview styling */
.barcode-label {
    border: 1px solid #ddd;
    margin: 5px;
    padding: 5px;
    font-family: Arial, sans-serif;
}

.product-name {
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 2px;
}

.size-price {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
}

img {
    max-width: 100%;
    height: auto;
}
#blazor-error-ui {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: #b32121;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: Arial, sans-serif;
    font-size: 14px;
    max-width: 90%;
    z-index: 1000;
    display: none;
}

    #blazor-error-ui a.reload {
        background: white;
        color: #b32121;
        padding: 0.4rem 0.8rem;
        border-radius: 4px;
        font-weight: bold;
        text-decoration: none;
        transition: background 0.3s ease, color 0.3s ease;
    }

        #blazor-error-ui a.reload:hover {
            background: #f7c0c0;
            color: #8b1a1a;
        }

    #blazor-error-ui .dismiss {
        background: none;
        border: none;
        color: white;
        font-size: 1.2rem;
        cursor: pointer;
        transition: color 0.3s ease;
    }

        #blazor-error-ui .dismiss:hover {
            color: #ffdddd;
        }

.blazor-error-boundary {
    background: #ffebeb;
    color: #b32121;
    padding: 1rem;
    border: 1px solid #b32121;
    border-radius: 6px;
    font-weight: bold;
}

    .blazor-error-boundary::after {
        content: "An unexpected error has occurred.";
        display: block;
        font-size: 14px;
        margin-top: 5px;
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}
.rz-grid-table thead th {
    background: #E6EAED;
}
.custom-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(90deg, rgb(210, 223, 251), rgb(248, 250, 254));
    padding: 16px;
    border-radius: 8px;
}

.banner-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.banner-text {
    display: flex;
    flex-direction: column;
}

    .banner-text h5 {
        font-weight: 500;
        margin: 0;
    }

    .banner-text p {
        font-size: 14px;
        margin: 4px 0 0;
    }

.btn-excel {
    background-color: #047C5A;
    color: white;
    border: none;
}

    .btn-excel:hover {
        background-color: #035C44;
    }

.tooltip-custom .tooltip-inner {
    background-color: #343a40;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.tooltip.bs-tooltip-end .tooltip-arrow::before {
    border-right-color: #343a40;
}

.custom-width {
    width: 400px; /* Adjust as needed */
}
.custom-date {
    width: 280px; /* Adjust as needed */
}
.custom-offcanvas {
    width: 680px !important;
    max-width: 680px !important;
}
.offcanvas-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff; /* Match offcanvas background */
    padding: 15px;
    border-top: 1px solid #ddd;
    z-index: 1050; /* Ensure it's above content */
    text-align: right;
}
.custom-offcanvas {
    display: flex;
    flex-direction: column;
    height: 100vh; /* Full height */
}

.offcanvas-body.content-scroll {
    flex-grow: 1;
    overflow-y: auto; /* Enables scrolling */
    max-height: calc(100vh - 120px); /* Adjust based on header/footer height */
    padding-bottom: 60px; /* Space for the footer */
}

.offcanvas-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff; /* Match modal background */
    padding: 15px;
    border-top: 1px solid #ddd;
    text-align: right;
    z-index: 1050;
}
.page-wrapper-new{
    height:200px;
}
.inventory-select-batch {
    width: 120px;
}

.inventory-input-qty {
    width: 80px;
}

.inventory-input-price {
    width: 100px;
}

.inventory-input-discount {
    width: 80px !important;
}

.inventory-input-discount-amount {
    width: 80px !important;
}

.inventory-select-tax {
    width: 100px;
}

.table td input,
.table td select {
    vertical-align: middle !important;
    margin: 0; /* remove extra margins */
    line-height: 1.5; /* ensure a uniform line height */
}

/* Optionally, you can also add custom classes if needed */
.inventory-input,
.inventory-select {
    vertical-align: middle;
}
.select-party-row {
    background-color: #f8f9fa;
    padding: 0.5rem;
    border-radius: 4px;
    cursor: pointer;
}

    .select-party-row:hover {
        background-color: #e9ecef;
    }

.border-dashed {
    border-style: dashed !important;
}

/* Make dropdown scrollable */
.dropdown-scrollable {
    max-height: 300px;
    overflow-y: auto;
    max-width: 402px;
}

/* Highlighted row styling */
.active-item {
    background-color: #007bff !important;
    color: #fff !important;
}
.rz-multiselect .rz-placeholder, .rz-dropdown .rz-placeholder {
    font-size: 13px !important;
}
.rz-menuitem, .rz-autocomplete-list-item, .rz-multiselect-item, .rz-autocomplete-items li, .rz-dropdown-items li, .rz-multiselect-items li, .rz-dropdown-item{
    font-size:14px !important;
}
.rz-listbox-filter-container .rz-inputtext, .rz-dropdown-filter-container .rz-inputtext, .rz-multiselect-filter-container .rz-inputtext{
    font-size:14px !important;
}
.mb-3{
    text-align:start;
}
/* Modern Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,.3);
    /*backdrop-filter: blur(5px);*/
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    width: 100%;
    max-width: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.form-grid {
    display: grid;
    gap: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.required-asterisk {
    color: #dc3545;
}

.modern-input {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 15px;
    transition: all 0.2s;
}

    .modern-input:focus {
        border-color: #4d90fe;
        box-shadow: 0 0 0 2px rgba(77, 144, 254, 0.2);
    }

.input-with-validation {
    position: relative;
}

.validation-message {
    bottom: -18px;
    font-size: 12px;
    color: #dc3545;
}

.editor-container {
    border-radius: 8px;
    overflow: hidden;
}

.attachment-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-top: 20px;
}

.attachment-icon {
    font-size: 24px;
    color: #e74c3c;
}

.attachment-info {
    flex: 1;
}

.attachment-name {
    font-weight: 500;
    margin-bottom: 3px;
}

.attachment-meta {
    font-size: 13px;
    color: #777;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #f0f0f0;
}
.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #777;
    cursor: pointer;
    transition: all 0.2s;
}

    .close-btn:hover {
        color: #333;
        transform: rotate(90deg);
    }

.with-spinner {
    position: relative;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .modal-container {
        margin: 0 15px;
    }
}
.modal-dialog-scrollable .modal-content{
    background: #ffffff;
}
.rz-datepicker:has(.rz-datepicker-trigger) > .rz-inputtext {
    height: 36px;
}
.rz-button-md {
    padding: 0;
    height: auto;
    line-height: 1.25rem;
    min-height: 0rem;
    min-width: 2.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 1.25px;
    text-transform: lowercase;
}
/* site.css or in a <style> block */
.btn-icon {
    width: 2.5rem; /* adjust as needed */
    height: 2.5rem; /* adjust as needed */
    padding: 0; /* no extra padding */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem; /* same as btn�s rounded corners */
}
.components-reconnect-modal {
    display: none !important;
}

/* ----------------------------------------------
   Responsive overflow fixes (tables + form fields)
   ---------------------------------------------- */
.page-wrapper,
.card-body,
.modal-body,
.offcanvas-body {
    max-width: 100%;
    overflow-x: auto;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
}

.table td,
.table th {
    white-space: nowrap;
}

input,
select,
textarea,
.form-control,
.form-select,
.rz-inputtext,
.rz-dropdown,
.rz-multiselect,
.rz-datepicker,
.input-group {
    max-width: 100%;
}

@media (max-width: 992px) {
    .custom-width,
    .custom-date {
        width: 100% !important;
    }

    .custom-offcanvas {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .inventory-select-batch,
    .inventory-input-qty,
    .inventory-input-price,
    .inventory-input-discount,
    .inventory-input-discount-amount,
    .inventory-select-tax {
        width: 100% !important;
        min-width: 90px;
    }

    .table td,
    .table th {
        white-space: nowrap;
    }
}

/* POS page — cancel RTL sidebar margin and fix overflow for full-height layout */
body.layout-mode-rtl .pos-pg-wrapper,
.pos-pg-wrapper {
    margin-right: 0 !important;
    margin-left: 0 !important;
    overflow: hidden !important;
}

/* ── Restaurant POS — global layout overrides (fixes Blazor RTL scoped CSS) ── */
.rpos-shell {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100vh - 60px) !important;
    overflow: hidden !important;
    background: #f1f5f9 !important;
    direction: rtl !important;
}
.rpos-topbar {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    height: 62px !important;
    background: #12151f !important;
    border-bottom: 1px solid #2e3350 !important;
    padding: 0 16px !important;
    gap: 12px !important;
}
.rpos-body {
    display: flex !important;
    flex-direction: row !important;
    flex: 1 !important;
    overflow: hidden !important;
    min-height: 0 !important;
}
.rpos-order-side {
    width: 370px !important;
    min-width: 320px !important;
    max-width: 370px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: #1a1e2e !important;
}
.rpos-menu-side {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: #f1f5f9 !important;
}

/* POS header — full width, flex layout, no float gap */
body.layout-mode-rtl .header.pos-header {
    right: 0 !important;
    left: 0 !important;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-direction: row-reverse;
    padding: 0 15px;
}

body.layout-mode-rtl .header.pos-header .header-left {
    float: none !important;
    border-left: none !important;
    width: auto;
}

body.layout-mode-rtl .header.pos-header .user-menu {
    float: none !important;
    display: flex !important;
    align-items: center;
}

/* ── Modern Calculator ─────────────────────────────── */
.calc-modal-content {
    border-radius: 16px;
    overflow: hidden;
    border: none;
    box-shadow: 0 20px 60px rgba(0,0,0,.18);
}

.calc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #4361ee;
    color: #fff;
    direction: rtl;
}

.calc-title {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.calc-close-btn {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
    font-size: 14px;
    padding: 0;
}
.calc-close-btn:hover { background: rgba(255,255,255,.3); }

.calc-display-wrap {
    background: #f8f9ff;
    padding: 12px 16px;
    border-bottom: 1px solid #e8eaf6;
}

.calc-display {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 32px;
    font-weight: 700;
    color: #1a1a2e;
    outline: none;
    direction: ltr;
    padding: 4px 0;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: #e8eaf6;
    padding: 1px;
}

.calc-btn {
    border: none;
    font-size: 20px;
    font-weight: 600;
    padding: 18px 10px;
    cursor: pointer;
    transition: filter .15s, transform .1s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.calc-btn:active { transform: scale(.93); }

.calc-btn-num    { background: #ffffff; color: #1a1a2e; }
.calc-btn-num:hover { filter: brightness(.95); }

.calc-btn-op     { background: #eef0fd; color: #4361ee; }
.calc-btn-op:hover { filter: brightness(.93); }

.calc-btn-clear  { background: #fff1f0; color: #e74c3c; }
.calc-btn-clear:hover { filter: brightness(.93); }

.calc-btn-back   { background: #fff8eb; color: #f59e0b; }
.calc-btn-back:hover { filter: brightness(.93); }

.calc-btn-equals {
    background: #4361ee;
    color: #ffffff;
    font-size: 24px;
}
.calc-btn-equals:hover { filter: brightness(1.1); }

/* ----------------------------------------------
   Global table & layout overflow containment
   ---------------------------------------------- */

/* Prevent the whole page from scrolling horizontally */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Main content wrapper — clip at the edge */
.page-wrapper .content,
.content {
    max-width: 100%;
    overflow-x: hidden;
}

/* Any card that holds a table: let the card itself scroll */
.card {
    min-width: 0;
}

/* Wrap every table in a scroll container automatically
   (covers tables that aren't already inside .table-responsive) */
.card-body > .table,
.card-body > table,
.content > .table,
.content > table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Ensure the table header/body/footer keep their display roles
   after we set the outer <table> to block */
.card-body > .table thead,
.card-body > .table tbody,
.card-body > .table tfoot,
.card-body > table thead,
.card-body > table tbody,
.card-body > table tfoot {
    display: table;
    width: 100%;
}

/* When .table-responsive wraps the table, let it own the scroll */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* Cells: keep nowrap so columns don't collapse, but let the container scroll */
.table td,
.table th {
    white-space: nowrap;
}

/* Page-header / top action bar — wrap on small screens */
.page-header {
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Container-fluid pages — honour viewport */
.container-fluid {
    max-width: 100%;
    overflow-x: hidden;
}

/* Grid rows inside cards — don't let them burst out */
.card .row {
    margin-left: 0;
    margin-right: 0;
}

/* Responsive: collapse columns earlier for dense tables */
@media (max-width: 1200px) {
    .table td,
    .table th {
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .page-btn {
        width: 100%;
    }
    .page-btn .btn {
        width: 100%;
    }
}

/* ----------------------------------------------
   Theme settings page
   ---------------------------------------------- */
.theme-settings-page .settings-wrapper {
    gap: 20px;
    align-items: stretch;
}

.theme-settings-surface {
    min-width: 0;
    background: #fff;
    border: 1px solid #edf0f4;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.05);
    overflow: hidden;
}

.theme-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px;
    border-bottom: 1px solid #edf0f4;
    background: linear-gradient(180deg, #fff, #f8fafc);
}

.theme-settings-header h4 {
    margin: 2px 0 0;
    color: #111827;
    font-size: 22px;
    font-weight: 700;
}

.theme-settings-kicker {
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.theme-settings-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.theme-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 24px;
}

.theme-setting-panel {
    border: 1px solid #edf0f4;
    border-radius: 8px;
    padding: 18px;
    background: #fff;
}

.theme-setting-title {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.theme-setting-title > i {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #1f4f46;
    background: #e9f5f2;
    font-size: 18px;
}

.theme-setting-title h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.theme-setting-title p {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 13px;
}

.theme-choice-grid,
.theme-color-grid {
    display: grid;
    gap: 12px;
}

.theme-choice-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.theme-choice-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.theme-choice-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.theme-color-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.theme-choice-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-choice-card,
.theme-color-card,
.theme-layout-card {
    min-height: 84px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.theme-choice-card:hover,
.theme-color-card:hover,
.theme-layout-card:hover {
    border-color: #9fb6ad;
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.07);
    transform: translateY(-1px);
}

.theme-choice-input:checked + .theme-choice-card,
.theme-choice-input:checked + .theme-color-card,
.theme-choice-input:checked + .theme-layout-card {
    border-color: #1f4f46;
    box-shadow: 0 0 0 3px rgba(31, 79, 70, .12);
}

.theme-choice-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #111827;
    font-size: 20px;
    flex: 0 0 auto;
}

.theme-choice-copy,
.theme-layout-card > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.theme-choice-copy strong,
.theme-layout-card strong {
    color: #111827;
    font-size: 14px;
}

.theme-choice-copy small,
.theme-layout-card small {
    color: #64748b;
    font-size: 12px;
    line-height: 1.35;
}

.theme-color-card {
    min-height: 58px;
}

.theme-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
    flex: 0 0 auto;
}

.theme-layout-preview {
    width: 58px;
    height: 42px;
    border-radius: 8px;
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 5px;
    padding: 6px;
    background: #eef2f7;
    flex: 0 0 auto;
}

.theme-layout-preview span:first-child,
.theme-layout-preview span:last-child {
    border-radius: 5px;
    background: #fff;
}

.theme-layout-preview.layout-mini {
    grid-template-columns: 8px 1fr;
}

[data-theme=dark] .theme-settings-surface,
[data-theme=dark] .theme-setting-panel,
[data-theme=professional] .theme-settings-surface,
[data-theme=professional] .theme-setting-panel {
    background: var(--nexterp-surface, #fff);
    border-color: var(--nexterp-border, #edf0f4);
}

[data-theme=dark] .theme-settings-header,
[data-theme=professional] .theme-settings-header {
    background: var(--nexterp-surface-muted, #f8fafc);
    border-color: var(--nexterp-border, #edf0f4);
}

[data-theme=dark] .theme-settings-header h4,
[data-theme=dark] .theme-setting-title h5,
[data-theme=dark] .theme-choice-copy strong,
[data-theme=dark] .theme-layout-card strong,
[data-theme=professional] .theme-settings-header h4,
[data-theme=professional] .theme-setting-title h5,
[data-theme=professional] .theme-choice-copy strong,
[data-theme=professional] .theme-layout-card strong {
    color: var(--nexterp-text, #111827);
}

[data-theme=dark] .theme-settings-kicker,
[data-theme=dark] .theme-setting-title p,
[data-theme=dark] .theme-choice-copy small,
[data-theme=dark] .theme-layout-card small,
[data-theme=professional] .theme-settings-kicker,
[data-theme=professional] .theme-setting-title p,
[data-theme=professional] .theme-choice-copy small,
[data-theme=professional] .theme-layout-card small {
    color: var(--nexterp-muted, #64748b);
}

[data-theme=dark] .theme-choice-card,
[data-theme=dark] .theme-color-card,
[data-theme=dark] .theme-layout-card,
[data-theme=professional] .theme-choice-card,
[data-theme=professional] .theme-color-card,
[data-theme=professional] .theme-layout-card {
    background: var(--nexterp-surface, #fff);
    border-color: var(--nexterp-border, #e5e7eb);
}

/* Mobile sidebar RTL fixes */
.sidebar-overlay.opened {
    display: block;
}

@media (max-width: 991.96px) {
    body.layout-mode-rtl .sidebar {
        left: auto;
        right: 0;
        margin-left: 0;
        margin-right: -575px;
    }

    body.layout-mode-rtl .main-wrapper.slide-nav .sidebar {
        margin-right: 0;
    }

    body.layout-mode-rtl .sidebar-overlay {
        left: 0;
        right: 0;
    }
}

/* ----------------------------------------------
   Professional theme
   ---------------------------------------------- */
[data-theme=professional] {
    --nexterp-bg: var(--ed-bg);
    --nexterp-surface: var(--ed-surface);
    --nexterp-surface-muted: var(--ed-surface-muted);
    --nexterp-border: var(--ed-border);
    --nexterp-text: var(--ed-text);
    --nexterp-muted: var(--ed-muted);
    --nexterp-accent: #b08d57;
}

[data-theme=professional] body,
body[data-theme=professional] {
    background: var(--ed-bg);
    color: var(--ed-text);
}

/* Shared chrome polish for all themes (except POS) */
.main-wrapper:not(.pos-three) .header {
    background: var(--ed-surface);
    border-bottom: 1px solid var(--ed-border);
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.main-wrapper:not(.pos-three) .header .header-left {
    background: var(--ed-surface);
    border-color: var(--ed-border);
}

.main-wrapper:not(.pos-three) .sidebar {
    background: var(--ed-surface);
    border-color: var(--ed-border);
    box-shadow: 8px 0 24px rgba(15, 23, 42, 0.04);
}

.main-wrapper:not(.pos-three) .sidebar .sidebar-menu > ul > li a {
    color: var(--ed-muted);
    border-radius: calc(var(--ed-radius) - 4px);
}

.main-wrapper:not(.pos-three) .sidebar .sidebar-menu > ul > li a:hover,
.main-wrapper:not(.pos-three) .sidebar .sidebar-menu > ul > li a.active {
    color: var(--primary-color);
    background: var(--ed-primary-soft);
}

[data-theme=professional] .theme-setting-title > i,
[data-theme=professional] .theme-choice-input:checked + .theme-choice-card .theme-choice-icon {
    color: #fff;
    background: var(--primary-color);
}

[data-theme=professional] .theme-choice-input:checked + .theme-choice-card,
[data-theme=professional] .theme-choice-input:checked + .theme-color-card,
[data-theme=professional] .theme-choice-input:checked + .theme-layout-card {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .14);
}

[data-theme=dark] .main-wrapper:not(.pos-three) .header,
[data-theme=dark] .main-wrapper:not(.pos-three) .header .header-left,
[data-theme=dark] .main-wrapper:not(.pos-three) .sidebar {
    background: var(--ed-surface);
    border-color: var(--ed-border);
}

@media (max-width: 1200px) {
    .theme-choice-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .theme-settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .theme-settings-page .settings-wrapper,
    .theme-settings-header {
        flex-direction: column;
        align-items: stretch;
    }

    .theme-settings-grid {
        padding: 16px;
    }

    .theme-choice-grid-2,
    .theme-choice-grid-3,
    .theme-choice-grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ----------------------------------------------
   Global ERP page design (all pages except POS)
   ---------------------------------------------- */
.main-wrapper:not(.pos-three) .page-wrapper {
    background: var(--ed-bg);
    color: var(--ed-text);
}

.main-wrapper:not(.pos-three) .page-wrapper .content,
.main-wrapper:not(.pos-three) .page-wrapper .container-fluid,
.main-wrapper:not(.pos-three) .page-wrapper .settings-content {
    color: var(--ed-text);
}

.main-wrapper:not(.pos-three) .page-header {
    margin-bottom: var(--ed-gap);
    gap: 0.75rem;
}

.main-wrapper:not(.pos-three) .page-header h4,
.main-wrapper:not(.pos-three) .page-wrapper h1,
.main-wrapper:not(.pos-three) .page-wrapper h2,
.main-wrapper:not(.pos-three) .page-wrapper h3,
.main-wrapper:not(.pos-three) .page-wrapper h4,
.main-wrapper:not(.pos-three) .page-wrapper h5,
.main-wrapper:not(.pos-three) .page-wrapper h6,
.main-wrapper:not(.pos-three) .page-wrapper .card-title {
    color: var(--ed-text);
}

.main-wrapper:not(.pos-three) .page-wrapper .card,
.main-wrapper:not(.pos-three) .page-wrapper .modal-content,
.main-wrapper:not(.pos-three) .page-wrapper .offcanvas,
.main-wrapper:not(.pos-three) .page-wrapper .dropdown-menu,
.main-wrapper:not(.pos-three) .page-wrapper .theme-settings-surface,
.main-wrapper:not(.pos-three) .page-wrapper .theme-setting-panel {
    background: var(--ed-surface);
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    box-shadow: var(--ed-shadow);
    color: var(--ed-text);
}

.main-wrapper:not(.pos-three) .page-wrapper .card .card-header,
.main-wrapper:not(.pos-three) .page-wrapper .card .card-footer,
.main-wrapper:not(.pos-three) .page-wrapper .modal-header,
.main-wrapper:not(.pos-three) .page-wrapper .modal-footer,
.main-wrapper:not(.pos-three) .page-wrapper .offcanvas-header {
    background: var(--ed-surface-muted);
    border-color: var(--ed-border);
    color: var(--ed-text);
}

.main-wrapper:not(.pos-three) .page-wrapper .card .card-body,
.main-wrapper:not(.pos-three) .page-wrapper .modal-body,
.main-wrapper:not(.pos-three) .page-wrapper .offcanvas-body {
    color: var(--ed-text);
}

.main-wrapper:not(.pos-three) .page-wrapper .table thead,
.main-wrapper:not(.pos-three) .page-wrapper .table thead th,
.main-wrapper:not(.pos-three) .page-wrapper .table-light,
.main-wrapper:not(.pos-three) .page-wrapper .rz-grid-table thead th,
.main-wrapper:not(.pos-three) .page-wrapper .rz-data-grid .rz-grid-table thead th {
    background: color-mix(in srgb, var(--ed-primary) 8%, var(--ed-surface)) !important;
    color: var(--ed-muted) !important;
    border-color: var(--ed-border) !important;
    height: 52px;
    padding: 0.8rem 1rem;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.main-wrapper:not(.pos-three) .page-wrapper .table tbody td,
.main-wrapper:not(.pos-three) .page-wrapper .rz-grid-table tbody td {
    border-color: color-mix(in srgb, var(--ed-border) 88%, transparent);
    color: var(--ed-text);
    min-height: 64px;
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.main-wrapper:not(.pos-three) .page-wrapper .table tbody tr,
.main-wrapper:not(.pos-three) .page-wrapper .rz-grid-table tbody tr {
    transition: background-color 0.18s ease;
}

.main-wrapper:not(.pos-three) .page-wrapper .table tbody tr:hover > *,
.main-wrapper:not(.pos-three) .page-wrapper .rz-grid-table tbody tr:hover > * {
    background: color-mix(in srgb, var(--ed-primary-soft) 55%, transparent) !important;
}

.main-wrapper:not(.pos-three) .page-wrapper .table-responsive,
.main-wrapper:not(.pos-three) .page-wrapper .rz-data-grid {
    scrollbar-color: color-mix(in srgb, var(--ed-primary) 35%, transparent) transparent;
    scrollbar-width: thin;
}

.main-wrapper:not(.pos-three) .page-wrapper .rz-data-grid .rz-paginator {
    min-height: 56px;
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--ed-border);
    background: var(--ed-surface-muted);
}

.main-wrapper:not(.pos-three) .page-wrapper .rz-paginator-page {
    border-radius: 9px;
}

.main-wrapper:not(.pos-three) .page-wrapper .rz-paginator-page.rz-state-active {
    background: var(--ed-primary);
    color: #fff;
}

.main-wrapper:not(.pos-three) .page-wrapper .form-control,
.main-wrapper:not(.pos-three) .page-wrapper .form-select,
.main-wrapper:not(.pos-three) .page-wrapper .rz-textbox,
.main-wrapper:not(.pos-three) .page-wrapper .rz-dropdown,
.main-wrapper:not(.pos-three) .page-wrapper .rz-numeric,
.main-wrapper:not(.pos-three) .page-wrapper .rz-datepicker,
.main-wrapper:not(.pos-three) .page-wrapper .input-group-text {
    background: var(--ed-surface);
    border-color: var(--ed-border);
    color: var(--ed-text);
    border-radius: calc(var(--ed-radius) - 4px);
}

.main-wrapper:not(.pos-three) .page-wrapper .form-control:focus,
.main-wrapper:not(.pos-three) .page-wrapper .form-select:focus {
    border-color: rgba(var(--primary-rgb), 0.55);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
}

.main-wrapper:not(.pos-three) .page-wrapper .btn {
    border-radius: calc(var(--ed-radius) - 4px);
    font-weight: 600;
}

.main-wrapper:not(.pos-three) .page-wrapper .btn-primary,
.main-wrapper:not(.pos-three) .page-wrapper .bg-primary {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.main-wrapper:not(.pos-three) .page-wrapper .btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.main-wrapper:not(.pos-three) .page-wrapper .btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff !important;
}

.main-wrapper:not(.pos-three) .page-wrapper .text-primary {
    color: var(--primary-color) !important;
}

.main-wrapper:not(.pos-three) .page-wrapper .badge.bg-primary,
.main-wrapper:not(.pos-three) .page-wrapper .page-link.active,
.main-wrapper:not(.pos-three) .page-wrapper .page-item.active .page-link {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.main-wrapper:not(.pos-three) .page-wrapper .nav-tabs .nav-link {
    color: var(--ed-muted);
    border-radius: calc(var(--ed-radius) - 4px) calc(var(--ed-radius) - 4px) 0 0;
}

.main-wrapper:not(.pos-three) .page-wrapper .nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-color: var(--ed-border) var(--ed-border) var(--ed-surface);
    background: var(--ed-surface);
}

.main-wrapper:not(.pos-three) .page-wrapper .alert {
    border-radius: var(--ed-radius);
    border-color: var(--ed-border);
}

.main-wrapper:not(.pos-three) .page-wrapper .list-group-item {
    background: var(--ed-surface);
    border-color: var(--ed-border);
    color: var(--ed-text);
}

.main-wrapper:not(.pos-three) .page-wrapper .text-muted,
.main-wrapper:not(.pos-three) .page-wrapper .form-text {
    color: var(--ed-muted) !important;
}

.main-wrapper:not(.pos-three) .page-wrapper .shadow-sm,
.main-wrapper:not(.pos-three) .page-wrapper .shadow {
    box-shadow: var(--ed-shadow) !important;
}

/* Settings surfaces follow the same system */
.main-wrapper:not(.pos-three) .settings-sidebar {
    background: var(--ed-surface);
    border-color: var(--ed-border);
}

.main-wrapper:not(.pos-three) .settings-sidebar .sidebar-menu > ul > li a {
    color: var(--ed-muted);
    border-radius: calc(var(--ed-radius) - 4px);
}

.main-wrapper:not(.pos-three) .settings-sidebar .sidebar-menu > ul > li a:hover,
.main-wrapper:not(.pos-three) .settings-sidebar .sidebar-menu > ul > li a.active {
    color: var(--primary-color);
    background: var(--ed-primary-soft);
}

/* Density controls */
[data-density="compact"] .main-wrapper:not(.pos-three) .page-wrapper .content,
[data-density="compact"] .main-wrapper:not(.pos-three) .page-wrapper .container-fluid,
[data-density="compact"] .main-wrapper:not(.pos-three) .page-wrapper .settings-content {
    --bs-gutter-x: 0.75rem;
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
}

[data-density="compact"] .main-wrapper:not(.pos-three) .page-header {
    margin-bottom: 0.85rem;
}

[data-density="compact"] .main-wrapper:not(.pos-three) .page-wrapper .card .card-header,
[data-density="compact"] .main-wrapper:not(.pos-three) .page-wrapper .card .card-body,
[data-density="compact"] .main-wrapper:not(.pos-three) .page-wrapper .card .card-footer,
[data-density="compact"] .main-wrapper:not(.pos-three) .page-wrapper .theme-setting-panel,
[data-density="compact"] .main-wrapper:not(.pos-three) .page-wrapper .ed-panel-header,
[data-density="compact"] .main-wrapper:not(.pos-three) .page-wrapper .ed-panel-body {
    padding: 0.75rem 0.9rem;
}

[data-density="compact"] .main-wrapper:not(.pos-three) .page-wrapper .table > :not(caption) > * > *,
[data-density="compact"] .main-wrapper:not(.pos-three) .page-wrapper .rz-grid-table td,
[data-density="compact"] .main-wrapper:not(.pos-three) .page-wrapper .rz-grid-table th {
    padding: 0.45rem 0.65rem;
}

[data-density="compact"] .sidebar .sidebar-menu > ul > li a {
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

/* Card style controls */
[data-card="outline"] .main-wrapper:not(.pos-three) .page-wrapper .card,
[data-card="outline"] .main-wrapper:not(.pos-three) .page-wrapper .modal-content,
[data-card="outline"] .main-wrapper:not(.pos-three) .page-wrapper .theme-setting-panel,
[data-card="outline"] .main-wrapper:not(.pos-three) .page-wrapper .theme-settings-surface {
    box-shadow: none !important;
    border-width: 1px;
}

[data-card="flat"] .main-wrapper:not(.pos-three) .page-wrapper .card,
[data-card="flat"] .main-wrapper:not(.pos-three) .page-wrapper .modal-content,
[data-card="flat"] .main-wrapper:not(.pos-three) .page-wrapper .theme-setting-panel,
[data-card="flat"] .main-wrapper:not(.pos-three) .page-wrapper .theme-settings-surface {
    box-shadow: none !important;
    border-color: transparent;
    background: color-mix(in srgb, var(--ed-surface) 92%, var(--ed-bg));
}

[data-card="flat"] .main-wrapper:not(.pos-three) .page-wrapper .card .card-header,
[data-card="flat"] .main-wrapper:not(.pos-three) .page-wrapper .card .card-footer {
    background: transparent;
}

/* Prevent duplicate sidebar DOM nodes from ever stacking visibly */
.main-wrapper > #sidebar ~ #sidebar {
    display: none !important;
}

.sidebar .slimScrollDiv > .slimScrollDiv {
    height: auto !important;
}

/* ----------------------------------------------
   Mobile bottom toolbar + PWA polish
   ---------------------------------------------- */
.mobile-bottom-nav,
.mobile-pwa-banner {
    display: none;
}

@media (max-width: 991.96px) {
    .main-wrapper:not(.pos-three) .mobile-bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        position: fixed;
        inset-inline: 0;
        bottom: 0;
        z-index: 1045;
        height: calc(64px + env(safe-area-inset-bottom, 0px));
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
        background: var(--ed-surface, #fff);
        border-top: 1px solid var(--ed-border, #e4e9ef);
        box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.08);
    }

    .main-wrapper:not(.pos-three) .page-wrapper {
        padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .main-wrapper:not(.pos-three) .app-version-footer {
        display: none;
    }

    .mbn-item {
        appearance: none;
        border: 0;
        background: transparent;
        color: var(--ed-muted, #64748b);
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-width: 0;
        min-height: 48px;
        padding: 4px 2px;
        font-size: 0.62rem;
        font-weight: 700;
        line-height: 1.1;
        -webkit-tap-highlight-color: transparent;
    }

    .mbn-item i {
        font-size: 1.2rem;
        line-height: 1;
    }

    .mbn-item span:not(.mbn-fab) {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mbn-item.active,
    .mbn-item:hover {
        color: var(--primary-color, #1f4f46);
    }

    .mbn-item-primary {
        position: relative;
        top: -12px;
        color: var(--primary-color, #1f4f46);
    }

    .mbn-fab {
        width: 48px;
        height: 48px;
        border-radius: 16px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: var(--primary-color, #1f4f46);
        color: #fff;
        box-shadow: 0 10px 24px rgba(var(--primary-rgb, 31, 79, 70), 0.35);
        margin-bottom: 2px;
    }

    .mbn-fab i {
        font-size: 1.25rem;
        color: #fff;
    }

    .mbn-item-primary.active .mbn-fab,
    .mbn-item-primary:hover .mbn-fab {
        transform: translateY(-1px);
    }

    .mobile-pwa-banner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        position: fixed;
        inset-inline: 10px;
        bottom: calc(74px + env(safe-area-inset-bottom, 0px));
        z-index: 1046;
        padding: 10px 12px;
        border-radius: 14px;
        background: var(--ed-surface, #fff);
        border: 1px solid var(--ed-border, #e4e9ef);
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
    }

    .mobile-pwa-banner-copy {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
    }

    .mobile-pwa-banner-copy strong {
        font-size: 0.82rem;
        color: var(--ed-text, #122033);
    }

    .mobile-pwa-banner-copy small {
        font-size: 0.72rem;
        color: var(--ed-muted, #64748b);
    }

    .mobile-pwa-banner-actions {
        display: flex;
        gap: 6px;
        flex-shrink: 0;
    }

    @media (display-mode: standalone) {
        .mobile-pwa-banner {
            display: none !important;
        }

        .main-wrapper:not(.pos-three) .mobile-bottom-nav {
            padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        }
    }
}

/* ----------------------------------------------
   Mobile app shell and PWA polish
   ---------------------------------------------- */
html,
body {
    max-width: 100%;
}

body {
    -webkit-tap-highlight-color: transparent;
}

@media (display-mode: standalone) {
    body {
        overscroll-behavior-y: contain;
    }
}

@media (max-width: 991.96px) {
    body {
        overflow-x: hidden;
    }

    .main-wrapper {
        min-height: 100dvh;
        overflow-x: hidden;
    }

    .page-wrapper,
    body.layout-mode-rtl .page-wrapper,
    body.layout-mode-rtl.mini-sidebar .page-wrapper {
        margin: 0 !important;
        padding-top: 60px;
        min-height: 100dvh;
    }

    .content,
    .settings-content,
    .page-wrapper > .content {
        padding: 14px !important;
        max-width: 100%;
        overflow-x: hidden;
    }

    .content .row,
    .settings-content .row,
    .page-wrapper > .content .row {
        min-width: 0;
    }

    .content [class*="col-"],
    .settings-content [class*="col-"],
    .page-wrapper > .content [class*="col-"],
    .content .card,
    .settings-content .card,
    .page-wrapper > .content .card,
    .content .card-body,
    .settings-content .card-body,
    .page-wrapper > .content .card-body {
        max-width: 100%;
        min-width: 0;
    }

    .content .d-flex,
    .settings-content .d-flex,
    .page-wrapper > .content .d-flex {
        min-width: 0;
    }

    .content img,
    .settings-content img,
    .page-wrapper > .content img {
        max-width: 100%;
        height: auto;
    }

    .page-header,
    .page-title,
    .card-title,
    .header-title {
        min-width: 0;
    }

    .page-header,
    .page-header .page-btn,
    .page-header .add-item {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
    }

    .page-header .btn,
    .page-header .page-btn .btn,
    .action-table-data .btn,
    .btn-icon {
        min-height: 40px;
    }

    .header {
        left: 0 !important;
        right: 0 !important;
        height: 60px;
        padding-inline: 8px;
    }

    .header .main-header,
    .header .user-menu {
        min-width: 0;
    }

    .header .user-menu {
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .header .user-menu::-webkit-scrollbar {
        display: none;
    }

    .header .nav-searchinputs,
    .header .select-store-dropdown {
        display: none !important;
    }

    .header .mobile_btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
    }

    .header .header-left {
        inset-inline-start: 52px;
        inset-inline-end: auto;
        width: auto;
        min-width: 118px;
        border: 0 !important;
        padding-inline: 8px;
    }

    .header .header-left .logo img,
    .header .header-left .logo-normal img {
        max-height: 38px;
        max-width: 108px;
        object-fit: contain;
    }

    .language-selector .select-pl {
        max-width: 132px;
        min-height: 38px;
        font-size: 12px;
    }

    .sidebar {
        width: min(84vw, 320px);
        max-width: 320px;
        z-index: 1040;
    }

    .sidebar .sidebar-inner {
        height: calc(100dvh - 60px);
    }

    .sidebar-overlay {
        top: 60px;
        z-index: 1035;
    }

    .card {
        border-radius: 8px;
    }

    .card-body,
    .card-header,
    .card-footer {
        padding: 14px !important;
    }

    .table-responsive,
    .rz-data-grid,
    .rz-grid,
    .rz-datatable,
    .table-wrapper {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-responsive > .table,
    .table-wrapper > .table,
    .rz-data-grid table,
    .rz-grid table,
    .rz-datatable table,
    .rz-grid-table {
        width: max-content;
        min-width: 720px;
        max-width: none;
    }

    .table-responsive > .table,
    .table-wrapper > .table {
        margin-bottom: 0;
    }

    .table:not(.table-responsive .table):not(.table-wrapper .table) {
        min-width: 100%;
    }

    .rz-data-grid .rz-cell-data,
    .rz-grid .rz-cell-data,
    .rz-datatable .rz-cell-data,
    .table td,
    .table th {
        white-space: nowrap;
    }

    body.layout-mode-rtl .table-responsive,
    body.layout-mode-rtl .table-wrapper,
    body.layout-mode-rtl .rz-data-grid,
    body.layout-mode-rtl .rz-grid,
    body.layout-mode-rtl .rz-datatable {
        direction: rtl;
        text-align: right;
    }

    .modal-dialog {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        margin: 12px auto;
    }

    .modal-content {
        max-height: calc(100dvh - 24px);
        overflow: hidden;
    }

    .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .form-control,
    .form-select,
    .btn {
        min-height: 40px;
    }

    .dropdown-menu {
        max-width: calc(100vw - 24px);
    }

    .settings-wrapper {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .settings-wrapper > .card,
    .settings-wrapper .card.flex-fill {
        flex: 1 1 auto !important;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .settings-wrapper .card-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    .settings-wrapper .card-header > .d-flex {
        flex-wrap: wrap;
        width: 100%;
    }

    .settings-wrapper .card-header .btn {
        flex: 1 1 150px;
        justify-content: center;
    }

    body.layout-mode-rtl .settings-wrapper,
    body.layout-mode-rtl .settings-wrapper .card,
    body.layout-mode-rtl .settings-wrapper .table-responsive {
        direction: rtl;
    }

    .settings-sidebar {
        width: 100%;
        max-width: none;
        position: static;
    }

    .settings-sidebar .sidebar-inner,
    .settings-sidebar .sidebar-menu ul {
        max-height: none;
    }

    .settings-sidebar .sidebar-menu > ul > li > ul {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .settings-sidebar .sidebar-menu a {
        min-height: 42px;
        padding: 9px 10px;
        border-radius: 8px;
    }
}

@media (max-width: 575.98px) {
    .content,
    .settings-content,
    .page-wrapper > .content {
        padding: 10px !important;
    }

    .page-header,
    .page-header .page-btn,
    .page-header .add-item {
        align-items: stretch;
    }

    .page-header .btn,
    .page-header .page-btn .btn,
    .page-header .add-item .btn {
        width: 100%;
    }

    .settings-sidebar .sidebar-menu > ul > li > ul {
        grid-template-columns: 1fr;
    }

    .modal-dialog {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        margin: 8px auto;
    }
}

/* ===== Brand logo fit (uploaded custom logo, any aspect ratio) ===== */
/* One uploaded image fills every slot (full / white / collapsed-icon) across
   HeaderLayout, Sidebar and PosHeader. object-fit:contain keeps aspect ratio;
   the per-slot max-* box lets a wide banner OR a square icon scale to fit
   without distortion or cropping. !important overrides the template defaults. */
img.brand-logo-img {
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
}

/* Full-size slots: header + expanded sidebar */
.header-left .logo img.brand-logo-img,
.header-left .logo-normal img.brand-logo-img,
.header-left .logo-white img.brand-logo-img,
.sidebar-logo .logo img.brand-logo-img,
.sidebar-logo .logo-normal img.brand-logo-img,
.sidebar-logo .logo-white img.brand-logo-img {
    max-height: 40px !important;
    max-width: 160px !important;
    width: auto !important;
}

/* Collapsed sidebar / small icon slot: constrain to a compact square-ish box */
.logo-small img.brand-logo-icon,
img.brand-logo-icon {
    max-height: 34px !important;
    max-width: 46px !important;
    width: auto !important;
    object-fit: contain !important;
}

/* ===== Professional notifications (Radzen) — platform-wide =====
   Styles every NotificationService.Notify() call across the app (174 usages)
   without touching any page code. RTL-aware. */
.rz-notification {
    top: 84px !important;                 /* clear the fixed header */
    inset-inline-end: 20px;
    inset-inline-start: auto;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(420px, calc(100vw - 32px));
}

.rz-notification .rz-notification-item {
    position: relative;
    border: 0;
    border-radius: 14px;
    padding: 14px 16px 14px 14px;
    background: #fff;
    color: #1f2937;
    box-shadow: 0 10px 30px rgba(16, 24, 40, .16), 0 2px 6px rgba(16, 24, 40, .08);
    overflow: hidden;
    animation: nx-toast-in .28s cubic-bezier(.21, 1.02, .73, 1) both;
}

/* Coloured accent bar on the leading edge */
.rz-notification .rz-notification-item::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 5px;
    background: var(--nx-toast, #6366f1);
}

.rz-notification .rz-notification-item.rz-notification-success { --nx-toast: #10b981; }
.rz-notification .rz-notification-item.rz-notification-error   { --nx-toast: #ef4444; }
.rz-notification .rz-notification-item.rz-notification-warning { --nx-toast: #f59e0b; }
.rz-notification .rz-notification-item.rz-notification-info    { --nx-toast: #3b82f6; }

.rz-notification .rz-notification-item .rz-notification-message { line-height: 1.55; font-size: 14px; }
.rz-notification .rz-notification-item .rz-notification-message h5,
.rz-notification .rz-notification-item .rz-notification-message .rz-notification-summary {
    font-weight: 700; font-size: 14.5px; margin: 0 0 2px; color: var(--nx-toast);
}
.rz-notification .rz-notification-item .notify-icon,
.rz-notification .rz-notification-item .rzi { color: var(--nx-toast); }

/* Close button — always visible, comfortable hit area */
.rz-notification .rz-notification-item { padding-inline-end: 44px; }
.rz-notification .rz-notification-item .rz-notification-close,
.rz-notification .rz-notification-item .nx-toast-close {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: rgba(15, 23, 42, .06);
    color: #475569;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    opacity: 1;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}
.rz-notification .rz-notification-item .rz-notification-close:hover,
.rz-notification .rz-notification-item .nx-toast-close:hover {
    background: rgba(15, 23, 42, .12);
    color: #0f172a;
    transform: scale(1.06);
}

/* 30s countdown progress bar */
.rz-notification .rz-notification-item .nx-toast-bar {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 3px;
    background: var(--nx-toast, #6366f1);
    opacity: .55;
    transform-origin: inline-start;
    animation: nx-toast-bar 30s linear forwards;
}
@keyframes nx-toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Slide in from the trailing side (respects RTL automatically) */
@keyframes nx-toast-in {
    from { opacity: 0; transform: translateX(24px) scale(.98); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
[dir="rtl"] .rz-notification .rz-notification-item { animation-name: nx-toast-in-rtl; }
@keyframes nx-toast-in-rtl {
    from { opacity: 0; transform: translateX(-24px) scale(.98); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

@media (max-width: 575.98px) {
    .rz-notification { top: 70px !important; inset-inline: 12px; max-width: none; }
}

/* ================================================================
   Mobile bottom toolbar — overlap hardening
   The toolbar is fixed at the bottom, so anything that sits at the
   bottom of the viewport (page content, modal footers, offcanvas,
   floating buttons, dropdowns, dialogs) must clear it.
   Height reference: 64px bar + iOS safe-area inset.
   ================================================================ */
:root { --nx-bottombar: 64px; }

@media (max-width: 991.96px) {
    /* Keep the bar above page content but BELOW offcanvas (1045),
       modal (1055) and toasts, so overlays are never blocked by it. */
    .main-wrapper:not(.pos-three) .mobile-bottom-nav { z-index: 1035; }

    /* 1) Generic content containers (pages that don't use .page-wrapper) */
    .main-wrapper:not(.pos-three) .content,
    .main-wrapper:not(.pos-three) .settings-content,
    .main-wrapper:not(.pos-three) .page-content {
        padding-bottom: calc(var(--nx-bottombar) + 22px + env(safe-area-inset-bottom, 0px));
    }

    /* 2) Modals — action buttons must not hide under the bar */
    .modal .modal-footer,
    .modal .modal-body:last-child {
        padding-bottom: calc(12px + var(--nx-bottombar) * 0.35 + env(safe-area-inset-bottom, 0px));
    }
    .modal-dialog-scrollable .modal-content { max-height: calc(100dvh - 24px); }

    /* 3) Offcanvas panels */
    .offcanvas.offcanvas-bottom { max-height: calc(100dvh - 64px); }
    .offcanvas .offcanvas-body {
        padding-bottom: calc(16px + var(--nx-bottombar) + env(safe-area-inset-bottom, 0px));
    }

    /* 4) Radzen dialogs / pickers */
    .rz-dialog { max-height: calc(100dvh - 90px); }
    .rz-dialog-content { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }

    /* 5) Floating / sticky action bars & FABs raised above the toolbar */
    .floating-action,
    .fab,
    .sticky-actions,
    .form-actions-fixed {
        bottom: calc(var(--nx-bottombar) + 14px + env(safe-area-inset-bottom, 0px)) !important;
    }

    /* 6) Dropdowns near the bottom flip upward instead of hiding behind the bar */
    .dropdown-menu.show { max-height: 60dvh; overflow-y: auto; }

    /* 7) Tables: last row / pagination stays reachable */
    .table-responsive { padding-bottom: 4px; }
    .dataTables_wrapper .dataTables_paginate { margin-bottom: 8px; }

    /* 8) Toast/notification stack sits above the bar when anchored bottom */
    .rz-notification { padding-bottom: calc(var(--nx-bottombar) + env(safe-area-inset-bottom, 0px)); }
}

/* Installed PWA (standalone): a little extra breathing room at the bottom */
@media (display-mode: standalone) and (max-width: 991.96px) {
    .main-wrapper:not(.pos-three) .page-wrapper {
        padding-bottom: calc(var(--nx-bottombar) + 30px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* ================================================================
   Platform-wide visual and bidirectional coherence
   ================================================================ */

html[dir="rtl"] body {
    direction: rtl;
    text-align: start;
}

html[dir="ltr"] body {
    direction: ltr;
    text-align: start;
}

html {
    scroll-padding-block-start: 76px;
}

body {
    color: var(--ed-text);
    background: var(--ed-bg);
    font-variant-numeric: tabular-nums;
}

::selection {
    color: #fff;
    background: var(--primary-color);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid rgba(var(--primary-rgb), 0.24);
    outline-offset: 2px;
    scroll-margin-block: 84px;
}

.main-wrapper:not(.pos-three) :where(.header, .sidebar, .page-wrapper, .card, .modal-content, .dropdown-menu, .offcanvas) {
    color: var(--ed-text);
}

.main-wrapper:not(.pos-three) .header,
.main-wrapper:not(.pos-three) .sidebar {
    border-color: var(--ed-border);
}

.main-wrapper:not(.pos-three) .btn-primary {
    color: #fff;
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

html[dir="rtl"] .main-wrapper:not(.pos-three) .sidebar {
    right: 0;
    left: auto;
    border-right: 0;
    border-left: 1px solid var(--ed-border);
    box-shadow: -8px 0 26px rgba(15, 35, 52, 0.045);
}

html[dir="ltr"] .main-wrapper:not(.pos-three) .sidebar {
    left: 0;
    right: auto;
    border-left: 0;
    border-right: 1px solid var(--ed-border);
    box-shadow: 8px 0 26px rgba(15, 35, 52, 0.045);
}

html[dir="rtl"] .main-wrapper:not(.pos-three) .page-wrapper {
    margin-right: 252px;
    margin-left: 0;
}

html[dir="ltr"] .main-wrapper:not(.pos-three) .page-wrapper {
    margin-left: 252px;
    margin-right: 0;
}

html[dir="rtl"] body.mini-sidebar .main-wrapper:not(.pos-three) .page-wrapper {
    margin-right: 80px;
}

html[dir="ltr"] body.mini-sidebar .main-wrapper:not(.pos-three) .page-wrapper {
    margin-left: 80px;
}

.main-wrapper:not(.pos-three) .page-wrapper .content,
.main-wrapper:not(.pos-three) .page-wrapper .settings-content {
    padding-block: clamp(1rem, 1.7vw, 1.75rem);
    padding-inline: clamp(0.85rem, 1.8vw, 1.75rem);
}

.main-wrapper:not(.pos-three) .page-wrapper .card {
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.main-wrapper:not(.pos-three) .page-wrapper .card:hover {
    border-color: color-mix(in srgb, var(--primary-color) 22%, var(--ed-border));
    box-shadow: var(--ed-shadow-hover);
}

.main-wrapper:not(.pos-three) .page-wrapper :where(.card-header, .modal-header, .offcanvas-header) {
    min-height: 58px;
    padding-inline: var(--ed-pad);
}

.main-wrapper:not(.pos-three) .page-wrapper :where(.form-label, label:not(.btn):not(.form-check-label)) {
    color: var(--ed-text);
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.main-wrapper:not(.pos-three) .page-wrapper :where(
    .form-control,
    .form-select,
    .rz-textbox,
    .rz-dropdown,
    .rz-numeric,
    .rz-datepicker,
    .input-group-text
) {
    min-height: 44px;
    border-color: var(--ed-border);
    background-color: var(--ed-surface);
    color: var(--ed-text);
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.main-wrapper:not(.pos-three) .page-wrapper :where(.form-control, .form-select)::placeholder {
    color: color-mix(in srgb, var(--ed-muted) 72%, transparent);
}

.main-wrapper:not(.pos-three) .page-wrapper :where(
    .form-control,
    .form-select,
    .rz-textbox,
    .rz-dropdown,
    .rz-numeric,
    .rz-datepicker
):focus-within,
.main-wrapper:not(.pos-three) .page-wrapper :where(.form-control, .form-select):focus {
    border-color: color-mix(in srgb, var(--primary-color) 68%, white);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.13);
}

.main-wrapper:not(.pos-three) .page-wrapper :where(.btn, .page-link, .nav-link) {
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 100ms ease;
}

.main-wrapper:not(.pos-three) .page-wrapper .btn:not(:disabled):active {
    transform: translateY(1px);
}

.main-wrapper:not(.pos-three) .page-wrapper .btn-primary {
    box-shadow: 0 5px 14px rgba(var(--primary-rgb), 0.18);
}

.main-wrapper:not(.pos-three) .page-wrapper .btn-primary:hover {
    background: color-mix(in srgb, var(--primary-color) 88%, black) !important;
    border-color: color-mix(in srgb, var(--primary-color) 88%, black) !important;
    box-shadow: 0 7px 18px rgba(var(--primary-rgb), 0.24);
}

.main-wrapper:not(.pos-three) .page-wrapper :where(.btn, .input-group-text) > i,
.main-wrapper:not(.pos-three) .page-wrapper :where(.btn, .input-group-text) > svg {
    flex: 0 0 auto;
    line-height: 1;
    vertical-align: middle;
}

.main-wrapper:not(.pos-three) .page-wrapper :where(.table, .rz-grid-table) {
    margin-bottom: 0;
    color: var(--ed-text);
}

.main-wrapper:not(.pos-three) .page-wrapper :where(.table, .rz-grid-table) th,
.main-wrapper:not(.pos-three) .page-wrapper :where(.table, .rz-grid-table) td {
    text-align: start;
    vertical-align: middle;
}

.main-wrapper:not(.pos-three) .page-wrapper :where(.table, .rz-grid-table) :is(.text-end, [dir="ltr"]) {
    font-variant-numeric: tabular-nums;
}

.main-wrapper:not(.pos-three) .page-wrapper :where(.table-responsive, .rz-data-grid) {
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    background: var(--ed-surface);
}

/* Native date/time controls remain LTR internally, while their labels and
   surrounding form keep the active page direction. */
.input-group:has(input[type="date"]),
.input-group:has(input[type="datetime-local"]),
.input-group:has(input[type="month"]),
.input-group:has(input[type="time"]),
.input-group:has(.custom-date),
.input-group:has(#daterange) {
    direction: ltr !important;
}

.input-group:has(input[type="date"]) .input-group-text,
.input-group:has(input[type="datetime-local"]) .input-group-text,
.input-group:has(input[type="month"]) .input-group-text,
.input-group:has(input[type="time"]) .input-group-text,
.input-group:has(.custom-date) .input-group-text,
.input-group:has(#daterange) .input-group-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding-inline: 0.75rem;
}

html[dir="rtl"] :where(.dropdown-menu, .modal-content, .offcanvas, .rz-dialog) {
    direction: rtl;
    text-align: start;
}

html[dir="ltr"] :where(.dropdown-menu, .modal-content, .offcanvas, .rz-dialog) {
    direction: ltr;
    text-align: start;
}

[data-theme="dark"] .main-wrapper:not(.pos-three) .page-wrapper :where(.table-responsive, .rz-data-grid) {
    background: var(--ed-surface);
}

@media (max-width: 991.96px) {
    html {
        scroll-padding-block-end: calc(var(--nx-bottombar) + 18px + env(safe-area-inset-bottom, 0px));
    }

    html[dir] .main-wrapper:not(.pos-three) .page-wrapper,
    html[dir] body.mini-sidebar .main-wrapper:not(.pos-three) .page-wrapper {
        margin-inline: 0 !important;
    }

    html[dir="rtl"] .main-wrapper:not(.pos-three) .sidebar {
        transform-origin: right center;
    }

    html[dir="ltr"] .main-wrapper:not(.pos-three) .sidebar {
        transform-origin: left center;
    }

    .main-wrapper:not(.pos-three) .page-wrapper .content,
    .main-wrapper:not(.pos-three) .page-wrapper .settings-content {
        padding-inline: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.skip-link {
    position: fixed;
    inset-block-start: 0.75rem;
    inset-inline-start: 0.75rem;
    z-index: 30000;
    padding: 0.7rem 1rem;
    color: #fff;
    background: var(--primary-color);
    border-radius: 0.6rem;
    box-shadow: var(--ed-shadow-hover);
    transform: translateY(-150%);
    transition: transform 150ms ease;
}

.skip-link:focus {
    color: #fff;
    transform: translateY(0);
}

.header .nav-item-box > a,
.header .mobile_btn,
.header .mobile-user-menu > a {
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.header button.mobile_btn {
    padding: 0;
    border: 0;
    background: transparent;
}

@media (max-width: 767.98px) {
    body {
        font-size: 16px;
    }

    input,
    select,
    textarea,
    .form-control,
    .form-select {
        font-size: 16px !important;
    }

    .table,
    .rz-grid-table,
    .btn,
    .mbn-item {
        font-size: 0.875rem;
    }
}
