body,
.h1, .h2, .h3, .h4, .h5, .h6,
h1, h2, h3, h4, h5, h6,
button, input, select, textarea {
    font-family: 'Cairo', sans-serif !important;
}

.menu-vertical .menu-item .menu-link.active .title,
.menu-vertical .menu-item .menu-link.active .menu-icon {
    color: #0f79f3 !important;
}

.menu-vertical .menu-item .menu-link.active {
    background-color: #f1f2fd;
    padding: 8px 12px !important;
}

.page-actions .btn {
    border-radius: 5px;
}

.status-badge {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 4px;
}

.status-pending { background-color: #fff3cd; color: #856404; }
.status-processing { background-color: #e7effd; color: #0f79f3; }
.status-shipped { background-color: #eafbf2; color: #0eac5d; }
.status-delivered { background-color: #d1e7dd; color: #198754; }
.status-canceled { background-color: #fdebf3; color: #e74c3c; }

.fs-14 { font-size: 14px; }
.fs-16 { font-size: 16px; }
.mb-19 { margin-bottom: 19px; }

.stats-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

#sidebar-area .logo .logo-text {
    position: static;
    transform: none;
}

.pagination {
    margin-bottom: 0;
}

/* Fix large empty space at top — Fila centers content vertically by default */
.main-content .inner-main-content {
    justify-content: flex-start !important;
    min-height: auto !important;
    padding-top: 20px;
    padding-bottom: 20px;
}

.main-content {
    padding-top: 0 !important;
}

.header-area {
    margin-top: 0 !important;
}

/* RTL layout overrides */
html[dir="rtl"] .sidebar-area {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid #eff3f9;
}

html[dir="rtl"] .main-content {
    padding-left: 12px;
    padding-right: 270px;
}

html[dir="rtl"] .header-area .src-form .src-btn {
    left: auto !important;
    right: 12px !important;
}

html[dir="rtl"] .header-area .src-form .form-control {
    padding-left: 15px;
    padding-right: 40px;
}

html[dir="rtl"] .menu-vertical .menu-item .menu-link .menu-icon {
    margin-left: 0.5rem;
    margin-right: 0;
}

@media only screen and (max-width: 1199px) {
    html[dir="rtl"] #sidebar-area {
        transform: translateX(100%);
    }

    html[dir="rtl"] #sidebar-area.show {
        transform: translateX(0);
        z-index: 9999;
    }

    html[dir="rtl"] .main-content {
        padding-right: 0 !important;
        padding-left: 0 !important;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 9998;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

@media only screen and (min-width: 1200px) and (max-width: 1399px) {
    html[dir="rtl"] .main-content {
        padding-right: 250px;
    }
}

/* POS order create */
.pos-layout {
    align-items: stretch;
}

.pos-catalog-card,
.pos-cart-card {
    height: 100%;
}

.pos-cart-card .card-body {
    min-height: 520px;
}

.pos-search-wrap {
    position: relative;
}

.pos-search-wrap .material-symbols-outlined {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 20px;
    pointer-events: none;
}

html[dir="rtl"] .pos-search-wrap .form-control {
    padding-right: 40px;
}

.pos-brand-filter-wrap {
    text-align: right;
}

.pos-brand-filter-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 10px;
}

.pos-brand-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

html[dir="rtl"] .pos-brand-filter {
    justify-content: flex-end;
}

.pos-brand-chip {
    border: 1px solid #eff3f9;
    background: #fff;
    color: #23272e;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pos-brand-chip:hover {
    border-color: #0f79f3;
    color: #0f79f3;
}

.pos-brand-chip.active {
    background: #0f79f3;
    border-color: #0f79f3;
    color: #fff;
}

.pos-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    max-height: calc(100vh - 320px);
    min-height: 360px;
    overflow-y: auto;
    padding-left: 2px;
}

.pos-product-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
    padding: 12px;
    border: 1px solid #eff3f9;
    border-radius: 10px;
    background: #fff;
    text-align: right;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.pos-product-image-wrap {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fc;
    margin-bottom: 6px;
}

.pos-product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eff3f9;
    background: #f8f9fc;
}

.product-show-image {
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #eff3f9;
    background: #f8f9fc;
}

.product-image-current {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #eff3f9;
    background: #f8f9fc;
}

.pos-cart-item-top {
    align-items: flex-start;
}

.pos-cart-item-image {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eff3f9;
    flex-shrink: 0;
    background: #f8f9fc;
}

.pos-product-card:hover:not(:disabled) {
    border-color: #0f79f3;
    box-shadow: 0 4px 14px rgba(15, 121, 243, 0.12);
    transform: translateY(-2px);
}

.pos-product-card:active:not(:disabled) {
    transform: translateY(0);
}

.pos-product-card.is-out-of-stock {
    opacity: 0.55;
    cursor: not-allowed;
}

.pos-product-brand {
    font-size: 11px;
    color: #0f79f3;
    background: #f1f2fd;
    padding: 2px 8px;
    border-radius: 20px;
}

.pos-product-name {
    font-size: 14px;
    font-weight: 600;
    color: #23272e;
    line-height: 1.4;
    margin-top: 4px;
}

.pos-product-sku {
    font-size: 11px;
    color: #9ca3af;
}

.pos-product-price {
    font-size: 15px;
    font-weight: 700;
    color: #0f79f3;
    margin-top: auto;
    padding-top: 8px;
}

.pos-product-stock {
    font-size: 11px;
    color: #6b7280;
}

.pos-product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 10px;
    background: #fdebf3;
    color: #e74c3c;
    padding: 2px 8px;
    border-radius: 4px;
}

.pos-cart-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: calc(100vh - 420px);
    overflow-y: auto;
}

.pos-cart-item {
    padding: 12px;
    border: 1px solid #eff3f9;
    border-radius: 10px;
    background: #fafbfc;
}

.pos-cart-item-top,
.pos-cart-item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.pos-cart-item-bottom {
    margin-top: 10px;
}

.pos-cart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #23272e;
}

.pos-cart-item-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.pos-cart-item-subtotal {
    font-size: 14px;
    color: #0f79f3;
}

.pos-qty-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #eff3f9;
    border-radius: 8px;
    padding: 2px;
}

.pos-qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #f1f2fd;
    color: #0f79f3;
    border-radius: 6px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-qty-btn:hover {
    background: #0f79f3;
    color: #fff;
}

.pos-qty-value {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.pos-cart-empty-icon {
    font-size: 48px;
    color: #d1d5db;
    display: block;
    margin-bottom: 8px;
}

.pos-cart-footer .fs-20 {
    font-size: 20px;
}

@media (max-width: 991px) {
    .pos-products-grid {
        max-height: 420px;
    }

    .pos-cart-card .card-body {
        min-height: auto;
    }

    .pos-cart-items {
        max-height: 280px;
    }
}
