:root {
    --nt-primary: linear-gradient(to bottom, #55088a, #870DDC);
    --nt-secondary: #21cbf3;
    --nt-accent: #f0f8ff;
    --bg: linear-gradient(135deg,#0f172a 0%, #1e293b 40%, #0ea5e9 100%);
    --card-bg: rgba(255,255,255,0.06);
    --card-border: rgba(255,255,255,0.12);
    --text: #e5e7eb;
    --muted: #94a3b8;
    --primary: #06b6d4;
    --primary-700: #0891b2;
    --shadow: 0 20px 40px rgba(0,0,0,.35);
    --danger: #dc3545;
    --success: #28a745;
    --warning: #ffc107;
}

.NT-FormRoot {
    background: var(--nt-primary);
    padding: 25px;
    border-radius: 8px;
    border: 2px solid #007acc;
    font-family: Arial, sans-serif;
    margin: 20px;
    margin-top: 0px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.NT-Label {
    color: steelblue;
    font-weight: bold;
    display: block;
    margin-bottom: 2px;
    font-size: 14px;
    font-family: "Cairo";
}
/* Styles for input fields */ 
.NT-Text {
    width: 100%;
    height: 40px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 14px;
    margin-bottom: 4px;
}
NT-Text:focus {
    border-color: #007acc;
    box-shadow: 0 0 5px rgba(0, 122, 204, 0.5);
    outline: double;
}
.NT-TextWithCaption {
    margin-bottom: 4px;
}

/*Edit BootStrap*/
.form-label {
    font-size: 16px;
    font-weight: 600;
    color: steelblue;
    margin-bottom: 2px;
    font-family: "Cairo", system-ui, -apple-system, Segoe UI, Roboto, Arial, serif;
}
.col-form-label {
    font-family: "Cairo", system-ui, -apple-system, Segoe UI, Roboto, Arial, serif;
    font-size: 12px;
    background: var(--nt-primary);
    border-bottom-right-radius: 10px;
    border-top-right-radius: 10px;
    color: aliceblue;
    margin-left: 0px;
    padding-inline-start: 12px;
}
.form-control {
    border-top-right-radius: 0px;
    border-bottom-right-radius: 0px;
    margin-right: 0px;
    align-items: stretch;
    padding: 8px;
}
.col-sm-3, .col-sm-6, .col-sm-9 {
    padding: 0px;
}

/* الفوتر الثابت */
.NT-ScreenFixedFooter {
    position: sticky;
    bottom: 0;
    height: auto;
    min-height: 50px;
    background: linear-gradient(to top, rgb(56, 5, 91), #6D0AB1);
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    z-index: 1000;
    padding: 0px;
    margin: 0;
    border-start-start-radius: 100px;
    border-start-end-radius: 100px;
    /* عرض الفوتر يتبع عرض الـ main content فقط */
    left: 0;
    right: 0;
    width: 100%;
}

/* على الشاشات الكبيرة، الفوتر يتبع عرض الـ main فقط (بعد الـ sidebar) */
@media (min-width: 641px) {
    .NT-ScreenFixedFooter {
        left: 250px; /* عرض الـ sidebar */
        right: 0;
        width: auto;
        /* مراعاة الـ padding في الـ article */
        padding-left: 2rem;
        padding-right: 1.5rem;
    }
}

/* إضافة padding-bottom للمحتوى لتجنب تغطية الفوتر */
/* يمكن إضافة هذه القاعدة مباشرة في الصفحات التي تستخدم الفوتر */
.frm-user {
    padding-bottom: 120px;
    min-height: calc(100vh - 100px);
}

/* الشكل الشجري للمنتجات */
.product-tree {
    font-family: "Cairo", system-ui, -apple-system, Segoe UI, Roboto, Arial, serif;
    direction: rtl;
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.profile-avatar-wrap {
    flex-shrink: 0;
}

.profile-avatar {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #dee2e6;
}

.profile-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f3f5;
    color: #6c757d;
}

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.2rem 0.55rem 0.2rem 0.2rem;
    margin: 0;
    border: 1px solid transparent;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    border-radius: 999px;
    line-height: 1;
    color: #ffffff;
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        transform 0.25s ease;
}

.user-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
    transform: translateY(-1px);
}

.user-menu-trigger:hover .user-menu-avatar-ring {
    transform: scale(1.06);
    box-shadow:
        0 0 0 3px rgba(219, 164, 250, 0.35),
        0 8px 20px rgba(0, 0, 0, 0.35);
}

.user-menu-trigger:hover .user-menu-caret {
    transform: translateY(1px);
    opacity: 1;
}

.user-menu-trigger:focus-visible {
    outline: 2px solid #dba4fa;
    outline-offset: 2px;
}

.user-menu-avatar-ring {
    display: inline-flex;
    padding: 2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dba4fa, #870ddc 45%, #5a9cff);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.user-menu-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(20, 8, 40, 0.55);
    display: block;
    background: #2a0a45;
}

.user-menu-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #6d0ab1, #3a0647);
    color: #f5e9ff;
}

.user-menu-name {
    font-family: "Cairo", sans-serif;
    font-size: 0.98rem;
    font-weight: 600;
    color: #ffffff;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-caret {
    color: rgba(255, 255, 255, 0.75);
    opacity: 0.85;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

@media (max-width: 640.98px) {
    .user-menu-name {
        max-width: 6.5rem;
    }
}

.tree-node {
    margin: 2px 0;
}

.tree-node-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s;
    user-select: none;
    gap: 8px;
}

.tree-node-header:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.tree-node-header.sub-category {
    padding-right: 30px;
    font-weight: 500;
}

.tree-node-header.product-header {
    padding-right: 50px;
    cursor: pointer;
}

.tree-node-header.product-header:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

.tree-icon {
    width: 16px;
    text-align: center;
    font-size: 12px;
    color: #6c757d;
    transition: transform 0.2s;
}

.tree-label {
    flex: 1;
    font-size: 14px;
    color: #212529;
}

.tree-badge {
    background-color: #e9ecef;
    color: #495057;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.tree-price {
    color: #28a745;
    font-weight: 600;
    font-size: 13px;
}

.tree-node-children {
    margin-right: 20px;
    border-right: 2px solid #e9ecef;
    padding-right: 8px;
}

.tree-node-children .tree-node-children {
    margin-right: 30px;
    border-right-color: #dee2e6;
}

/* عنوان الحوار: إفساح مكان لزر الإغلاق في أعلى اليمين حتى لا يغطي النص */
.mud-dialog .mud-dialog-title {
    position: relative;
    padding: 16px 56px 16px 24px !important;
}

.mud-dialog .mud-dialog-close-button {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    left: auto !important;
    z-index: 2;
}

/* تلوين تابات شاشة إعدادات النظام */
.nt-systemsetting-tabs .mud-tabs-indicator {
    background: linear-gradient(90deg, rgb(89, 7, 134), rgb(58, 6, 71)) !important;
    height: 3px;
}

.nt-systemsetting-tabs .mud-tab {
    font-weight: 800;
    color: #3a0647;
    border-radius: 10px;
    padding: 8px 14px;
    margin: 4px 2px;
}

.nt-systemsetting-tabs .mud-tab-active {
    background: linear-gradient(180deg, rgba(89, 7, 134, 0.18), rgba(58, 6, 71, 0.08)) !important;
    color: #590786 !important;
    box-shadow: 0 6px 18px rgba(89, 7, 134, 0.18);
    border: 1px solid rgba(89, 7, 134, 0.25);
}

/* إصلاح RTL لحقول MudBlazor Outlined - Label و notch */
/*[dir="rtl"] .mud-input-outlined-border legend {
    text-align: right;
    margin-left: auto;
    margin-right: 0;
}

[dir="rtl"] .mud-input-outlined .mud-input-label {
    right: 0;
    left: auto;
    transform-origin: top right;
}

[dir="rtl"] .mud-input-outlined .mud-input-label-inputcontrol {
    right: 14px;
    left: auto;
}*/

/* padding داخل حقول أيام الإشعارات في إعدادات النظام */
/*.nt-notify-days-field .mud-input-slot {
    padding: 10px 14px !important;
}

.nt-notify-days-field .mud-input-outlined input {
    padding: 12px 16px !important;
}*/

.nt-notify-days-field .mud-input-outlined-border {
    text-align: right !important;
}

.nt-notify-days-field label {
    left: auto !important;
    right: 30px !important;
    transform-origin: top right !important;
    font-size: 1.2rem !important;
}
.nt-notify-days-field input {
    padding:  15px 25px 10px 25px !important;
}

/* 1. محاذاة الإطار وضبط الفتحة تلقائياً مع طول النص */

.nt-notify-days-field fieldset {
    text-align: right !important;
}



/* 2. جعل عنصر الـ legend (المسؤول عن فتحة النوتش) يتكيف مع طول النص */

.nt-notify-days-field legend {
    width: auto !important;
    max-width: 100% !important;
    padding:   0 30px 0 30px !important;
}

/* تأكيد المبلغ النقدي في الخزينة */
.mkt-cash-confirm {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin:  0.35rem 0 0.5rem;
    padding: 0.02rem 0.65rem;
    border-radius: 10px;
    border: 1px solid transparent;
}

.mkt-cash-confirm.is-pending {
    background: #fff8e6;
    border-color: #ffc107;
}

.mkt-cash-confirm.is-confirmed {
    background: #e8f8ef;
    border-color: #28a745;
}

.mkt-cash-confirm-icon {
    font-size: 1.4rem !important;
}

.mkt-cash-confirm.is-pending .mkt-cash-confirm-icon {
    color: #c79100;
}

.mkt-cash-confirm.is-confirmed .mkt-cash-confirm-icon {
    color: #28a745;
}

/* ===== فاتورة المبيعات: أصناف + أقساط ===== */
.sales-details-card {
    border: 2px solid #6d0ab1 !important;
    background: #fff;
}

.sales-details-table > :not(caption) > * > * {
    padding: 0.12rem 0.2rem;
}

.sales-detail-input {
    border-radius: 0.25rem !important;
    padding: 0.1rem 0.25rem !important;
    font-size: 0.8rem !important;
    line-height: 1.2 !important;
    min-height: 1.7rem;
}

.sales-detail-price,
.sales-detail-money {
    max-width: none;
    min-width: 5.5rem;
    width: 100%;
    text-align: left;
    direction: ltr;
}

/* إخفاء أسهم الزيادة/النقصان في حقول الأرقام */
.sales-details-table input[type="number"]::-webkit-outer-spin-button,
.sales-details-table input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.sales-details-table input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.sales-detail-code-name {
    min-width: 7.5rem;
    max-width: 12rem;
}

.sales-detail-name-under {
    display: block;
    margin-top: 0.1rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #3a0647;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sales-detail-name {
    display: inline-block;
    min-width: 10rem;
    max-width: 100%;
    font-size: 0.875rem;
    font-weight: 600;
    color: #3a0647;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.sales-offer-meta {
    font-size: 0.72rem;
    line-height: 1.25;
}

@media print {
    body * {
        visibility: hidden !important;
    }
    .nt-print-area,
    .nt-print-area * {
        visibility: visible !important;
    }
    .nt-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .nt-no-print {
        display: none !important;
    }
}

.sales-inst-header {
    flex-wrap: nowrap !important;
}

.sales-inst-actions {
    flex-shrink: 0;
}

.sales-inst-actions .sales-inst-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: auto;
    height: 2.15rem;
    min-height: 2.15rem;
    padding: 0.35rem 0.9rem;
    border-radius: 12px;
    font-weight: 700;
    line-height: 1;
    box-shadow: none;
}

.sales-inst-params {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.55rem 0.75rem;
}

.sales-inst-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.sales-inst-label {
    margin: 5px;
    font-size: 1rem;
    font-weight: 700;
    color: #510464;
    line-height: 1;
    white-space: nowrap;
}

.sales-inst-field .form-control,
.sales-inst-field .form-select {
    border-radius: 0.375rem;
    border: 1px solid rgba(245, 233, 255, 0.35);
    min-height: 2.15rem;
    height: 2.15rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    background-color: #6d0ab1;
    color: #ffffff;
    box-shadow: none;
}

.sales-inst-field .form-control::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

.sales-inst-field .form-control:focus,
.sales-inst-field .form-select:focus {
    border-color: #f5e9ff;
    box-shadow: 0 0 0 0.15rem rgba(109, 10, 177, 0.28);
    background-color: #7a12c4;
    color: #ffffff;
}

.sales-inst-field .form-select {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    line-height: 1.35;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

.sales-inst-field .form-select option {
    background-color: #3a0647;
    color: #ffffff;
}

/* تاريخ المتصفح: أيقونة واضحة على خلفية موف */
.sales-inst-field input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.9;
    cursor: pointer;
}

.sales-inst-down {
    width: 7.25rem;
}

.sales-inst-down-date {
    width: 7.5rem;
}

.sales-inst-count {
    width: 4.5rem;
}

.sales-inst-start {
    width: 7.5rem;
}

.sales-inst-period {
    width: 3.5rem;
}

.sales-inst-unit {
    width: 5.75rem;
}

