/* Custom CSS to support Tailwind-like utility classes used by Heroicons */
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-7 { width: 1.75rem; }
.h-7 { height: 1.75rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }

/* Ensure SVGs respect these dimensions */
svg.w-4 { width: 1rem; }
svg.h-4 { height: 1rem; }
svg.w-5 { width: 1.25rem; }
svg.h-5 { height: 1.25rem; }
svg.w-6 { width: 1.5rem; }
svg.h-6 { height: 1.5rem; }

/* حجز مساحة اسم المنتج في بطاقات نقطة البيع (3 أسطر مع قطع الزائد) */
.product-name-3-lines {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    min-height: calc(0.95rem * 1.4 * 3);
}

/* مجموعة اختيار العميل في نقطة البيع */
.pos-customer-group {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.pos-customer-group .select2-container {
    flex: 1 1 auto;
    min-width: 0;
}

.pos-customer-group .select2-container .select2-selection {
    height: 42px !important;
    display: flex;
    align-items: center;
    border-radius: 0.5rem;
    border-color: #dee2e6;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pos-customer-group .select2-container--focus .select2-selection,
.pos-customer-group .select2-container--open .select2-selection {
    border-color: #80bdff;
    box-shadow: 0 0 0 3px rgba(71, 136, 255, 0.15);
}

.pos-customer-group .select2-selection .select2-selection__rendered {
    line-height: normal !important;
    padding-right: 12px !important;
    font-weight: 600;
}

.pos-customer-group .select2-selection .select2-selection__placeholder {
    color: #6c757d;
}

.pos-customer-group .select2-selection .select2-selection__arrow {
    height: 40px !important;
}

.pos-add-customer-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    white-space: nowrap;
    height: 42px;
    padding: 0 1.1rem;
    border-radius: 0.5rem;
    font-weight: 700;
}

.pos-add-customer-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(71, 136, 255, 0.35);
}

@media (max-width: 576px) {
    .pos-customer-group { gap: 0.35rem; }
    .pos-add-customer-btn span { display: none; }
    .pos-add-customer-btn { padding: 0 0.8rem; }
}

/* RTL-specific adjustments for Arabic */
html[dir="rtl"] .iq-arrow-right {
    transform: scaleX(-1);
}

html[dir="rtl"] .ml-3,
html[dir="rtl"] .ml-4 {
    margin-left: 0;
    margin-right: 1rem;
}

html[dir="rtl"] .ml-2 {
    margin-left: 0;
    margin-right: 0.5rem;
}

html[dir="rtl"] .ml-1 {
    margin-left: 0;
    margin-right: 0.25rem;
}

html[dir="rtl"] .ml-0 {
    margin-left: 0;
    margin-right: 0;
}

html[dir="rtl"] .pl-3 {
    padding-left: 0;
    padding-right: 1rem;
}

html[dir="rtl"] .float-right {
    float: none !important;
}

html[dir="rtl"] .input-group-append {
    margin-right: 0;
    margin-left: 0.5rem;
}

html[dir="rtl"] .input-group-text {
    border-radius: 0.375rem 0 0 0.375rem !important;
    border-radius: 0.375rem 0 0 0.375rem;
}

html[dir="rtl"] .mr-2 {
    margin-right: 0;
    margin-left: 0.5rem;
}

html[dir="rtl"] .mr-3 {
    margin-right: 0;
    margin-left: 1rem;
}

html[dir="rtl"] .d-flex.align-items-center.justify-content-between > *:first-child {
    order: 2;
}

html[dir="rtl"] .d-flex.align-items-center.justify-content-between > *:last-child {
    order: 1;
}

html[dir="rtl"] .profile-tab {
    flex-direction: row-reverse;
}

html[dir="rtl"] .profile-tab .nav-item {
    margin-left: 0;
    margin-right: 0.5rem;
}

html[dir="rtl"] .profile-tab .nav-item:not(:last-child) {
    margin-left: 0;
    margin-right: 0.5rem;
}

html[dir="rtl"] .profile-tab .nav-link {
    direction: rtl;
}

html[dir="rtl"] .list-action {
    flex-direction: row-reverse;
}

html[dir="rtl"] .list-action .btn {
    margin-left: 0.5rem;
    margin-right: 0;
}

html[dir="rtl"] .list-action .btn:first-child {
    margin-left: 0.5rem;
    margin-right: 0;
}

html[dir="rtl"] .table th,
html[dir="rtl"] .table td {
    text-align: right;
}

html[dir="rtl"] .text-right {
    text-align: right !important;
}

html[dir="rtl"] .text-left {
    text-align: left !important;
}

html[dir="rtl"] .badge {
    margin-left: 0.25rem;
    margin-right: 0;
}

/* جعل حقول الإدخال الرقمية (أعداد/كميات/مبالغ) تُعرض من اليسار لليمين */
input[type="number"],
input[inputmode="numeric"],
input[inputmode="decimal"],
input[data-money],
input[name$="_price"],
input[name="quantity"],
input[name="stock"],
input[name="salary"],
input[name="due_amount"],
input[name="pay_amount"] {
    direction: ltr;
    text-align: left;
}

/* إخفاء أسهم الزيادة/التنقيص في حقول الأرقام */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
