/* نظام إدارة المستودعات - ملف التصميم الرئيسي */

:root {
    --border-color: #000;
    --accent: #0b5ed7;
    --bg: #fff;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* استثناء أيقونات Font Awesome من توحيد الخطوط */
*:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not(.fad):not(i[class*="fa-"]) {
    font-family: 'Rubik', sans-serif !important;
}

/* التأكد من أن أيقونات Font Awesome تستخدم الخط الصحيح */
.fa, .fas, .far, .fab, .fal, .fad, i[class*="fa-"] {
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands" !important;
    font-weight: 900;
}

html, body {
    direction: rtl;
    background: #f8f9fa;
    color: #1a1a1a;
    font-family: 'Rubik', sans-serif !important;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

/* شريط التنقل */
.navbar {
    background: #343a40;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    flex-wrap: wrap;
    min-height: 60px;
}

.navbar-brand {
    font-size: 24px;
    font-weight: 600;
}

.navbar-nav {
    display: flex;
    gap: 15px;
    align-items: center;
    list-style: none;
    flex-wrap: wrap;
    max-width: 70%;
}

.navbar-nav a {
    color: #fff !important;
    text-decoration: none !important;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background 0.3s;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.navbar-nav a:hover {
    background: rgba(255,255,255,0.1) !important;
    color: #fff !important;
    text-decoration: none !important;
}

.navbar-nav a:visited {
    color: #fff !important;
    text-decoration: none !important;
}

.navbar-nav a:focus {
    color: #fff !important;
    text-decoration: none !important;
    outline: none;
}

.user-info {
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-info .role {
    background: var(--accent);
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 14px;
}

/* شارة الإشعارات */
.notification-badge {
    background: var(--danger) !important;
    color: white !important;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    margin-right: 5px;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    line-height: 1;
}

/* تنسيق خاص لزر الخروج */
.navbar-nav a[href="logout.php"] {
    background: var(--danger) !important;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 5px;
    padding: 8px 15px;
    transition: all 0.3s;
}

.navbar-nav a[href="logout.php"]:hover {
    background: #c82333 !important;
    color: #fff !important;
    text-decoration: none !important;
    transform: none;
}

/* تحسينات شريط التنقل للشاشات الصغيرة */
@media (max-width: 1200px) {
    .navbar {
        padding: 10px 15px;
    }
    
    .navbar-nav {
        gap: 10px;
        max-width: 75%;
    }
    
    .navbar-nav a {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    .navbar-brand {
        font-size: 20px;
    }
}

@media (max-width: 992px) {
    .navbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .navbar-nav {
        max-width: 100%;
        justify-content: center;
    }
    
    .navbar-brand {
        text-align: center;
        margin-bottom: 5px;
    }
}

@media (max-width: 768px) {
    .navbar-nav {
        gap: 8px;
    }
    
    .navbar-nav a {
        padding: 5px 10px;
        font-size: 13px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .user-info .role {
        font-size: 12px;
    }
}

/* الحاوي الرئيسي */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

h1 {
    color: #1a1a1a;
    margin-bottom: 30px;
    font-weight: 600;
}

/* البطاقات */
.card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 30px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.card-header {
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa !important; /* لون قريب من خلفية الصفحة */
    color: #000; /* لون النص أسود */
}

.card-title {
    color: #1a1a1a;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

/* تأكيد أن عنوان البطاقة داخل الرأس لونه أسود */
.card-header .card-title {
    color: #1a1a1a;
}

/* الأزرار */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
    cursor: pointer;
    background: #f6f6f6;
    color: #000;
}

.btn:hover {
    background: #eee;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.btn-primary:hover {
    background: #0a4fc5;
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: var(--warning);
    color: #212529;
    border-color: var(--warning);
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-info {
    background: var(--info);
    color: #fff;
    border-color: var(--info);
}

.btn-info:hover {
    background: #138496;
}

/* النماذج */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 16px;
    font-family: 'Rubik', sans-serif;
    background: #fff;
    color: #1a1a1a;
    transition: all 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 16px;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
}

/* الجداول */
.table-container {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: visible;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    display: table;
}

.table th {
    background: #f2f6ff;
    color: #333;
    padding: 12px;
    text-align: center;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.table td {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* الرسائل */
.alert {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    border: 1px solid;
    font-weight: 600;
}

.alert-success {
    background: #d4edda;
    border-color: var(--success);
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border-color: var(--danger);
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: var(--warning);
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: var(--info);
    color: #0c5460;
}

/* الشبكة */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -15px;
}

.col {
    flex: 1;
    padding: 15px;
}

.col-2 {
    flex: 0 0 16.666667%;
    padding: 15px;
}

.col-3 {
    flex: 0 0 25%;
    padding: 15px;
}

.col-4 {
    flex: 0 0 33.333333%;
    padding: 15px;
}

.col-6 {
    flex: 0 0 50%;
    padding: 15px;
}

.col-8 {
    flex: 0 0 66.666667%;
    padding: 15px;
}

.col-12 {
    flex: 0 0 100%;
    padding: 15px;
}

/* الإحصائيات */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-card .icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.stat-card .number {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #333;
}

.stat-card .label {
    font-size: 18px;
    color: #666;
}

.stat-card.blue { border-top: 4px solid var(--accent); }
.stat-card.green { border-top: 4px solid var(--success); }
.stat-card.yellow { border-top: 4px solid var(--warning); }
.stat-card.red { border-top: 4px solid var(--danger); }

/* البطاقات المدمجة على سطر واحد */
.stats-row {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat-card-compact {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 200px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card-compact:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-card-compact .stat-icon {
    font-size: 32px;
    line-height: 1;
}

.stat-card-compact .stat-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stat-card-compact .stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.stat-card-compact .stat-label {
    font-size: 14px;
    color: #666;
    margin-top: 2px;
}

.stat-card-compact.blue { border-right: 4px solid var(--accent); }
.stat-card-compact.green { border-right: 4px solid var(--success); }
.stat-card-compact.yellow { border-right: 4px solid var(--warning); }
.stat-card-compact.red { border-right: 4px solid var(--danger); }
.stat-card-compact.purple { border-right: 4px solid #9b59b6; }

@media (max-width: 768px) {
    .stats-row {
        flex-direction: column;
    }
    
    .stat-card-compact {
        min-width: 100%;
    }
}

/* بطاقات الإجراءات */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.action-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 25px;
    text-align: center;
}

.action-card h3 {
    margin-bottom: 15px;
    color: #333;
}

.action-card p {
    color: #666;
    margin-bottom: 20px;
}

/* الشارات */
.badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success { background: var(--success); color: white; }
.badge-info { background: var(--info); color: white; }
.badge-warning { background: var(--warning); color: #212529; }
.badge-danger { background: var(--danger); color: white; }
.badge-secondary { background: #6c757d; color: white; }

/* صفحة تسجيل الدخول */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: #f8f9fa;
}

.login-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-title {
    color: #333;
    font-size: 2rem;
    margin-bottom: 10px;
}

.login-subtitle {
    color: #666;
    font-size: 1rem;
}

/* الاستجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }

    .navbar-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .row {
        flex-direction: column;
    }
    
    .col, .col-2, .col-3, .col-4, .col-6, .col-8, .col-12 {
        flex: 0 0 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 20px;
    }
}

/* حقل البحث العام */
.search-container {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-box {
    flex: 1;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: 'Rubik', sans-serif;
    color: #1a1a1a;
}

.search-box input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 1.1rem;
}

.search-box input:focus + i {
    color: #3498db;
}

/* تحسين التباين للجداول */
.table th {
    background: #2c3e50 !important;
    color: white !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
}

.table td {
    color: #1a1a1a !important;
    font-size: 0.95rem !important;
}

.table td strong {
    color: #000 !important;
    font-weight: 600 !important;
}

/* تحسينات إضافية */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* الإشعارات */
.notifications-list {
    padding: 0;
}

.notification-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ecf0f1;
    transition: background-color 0.3s ease;
}

.notification-item:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

.notification-item.unread {
    background-color: rgba(52, 152, 219, 0.1);
    border-right: 4px solid var(--accent);
}

.notification-content {
    flex: 1;
}

.notification-message {
    font-size: 1rem;
    color: #333;
    margin-bottom: 5px;
}

.notification-meta {
    font-size: 0.85rem;
    color: #666;
}

.notification-meta span {
    margin-left: 15px;
}

.notification-actions {
    display: flex;
    gap: 10px;
}

.notification-item:last-child {
    border-bottom: none;
}

/* مجموعة الأزرار */
.btn-group {
    display: flex;
    gap: 5px;
}

.btn-group .btn {
    margin: 0;
}

/* الشارات */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 12px;
    text-align: center;
    white-space: nowrap;
}

.badge-primary {
    background-color: var(--accent);
    color: white;
}

.badge-success {
    background-color: var(--success);
    color: white;
}

.badge-warning {
    background-color: var(--warning);
    color: #212529;
}

.badge-danger {
    background-color: var(--danger);
    color: white;
}

.badge-info {
    background-color: var(--info);
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* تسميات الـ checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
}

/* مجموعة checkboxes */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
}

.checkbox-group .checkbox-label {
    margin: 0;
    padding: 5px 0;
}

/* تنسيقات فواتير الموردين */
.autocomplete-container {
    position: relative;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 5px 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f1f3f4;
}

.suggestion-item:hover {
    background-color: #f8f9fa;
}

.suggestion-item.selected {
    background-color: #e3f2fd;
    border-left: 3px solid var(--accent);
    font-weight: 600;
}

.suggestion-item:last-child {
    border-bottom: none;
}

/* تحسين عرض الجدول مع القوائم المنسدلة */
.table {
    position: relative;
}

.table tbody tr {
    position: relative;
}

.table tbody td {
    overflow: visible;
}

/* تأكد من أن القوائم المنسدلة تظهر فوق كل شيء */
.autocomplete-container {
    position: relative;
    z-index: 1;
}

.autocomplete-container .suggestions-dropdown {
    z-index: 9999;
    /* تأكد من عدم القص بواسطة الحاوية الأم */
    margin-top: 0;
}

/* إزالة أي قص محتمل من الجدول */
.table,
.table tbody,
.table tbody tr,
.table tbody td {
    overflow: visible !important;
}

/* تحسين التمرير في القائمة المنسدلة */
.suggestions-dropdown::-webkit-scrollbar {
    width: 8px;
}

.suggestions-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.suggestions-dropdown::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.suggestions-dropdown::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* تنسيقات اقتراحات المنتجات */
.product-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 9999;
    display: none;
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.selected {
    background-color: #f8f9fa;
}

.suggestion-item.no-results {
    color: #999;
    text-align: center;
    cursor: default;
}

.suggestion-item.no-results:hover {
    background-color: white;
}

.product-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.product-info strong {
    color: #2c3e50;
    font-size: 0.95rem;
}

.product-code {
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 500;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
}

.available-qty {
    color: #27ae60;
    font-weight: 500;
}

.product-price {
    color: #e67e22;
    font-weight: 600;
}

.total-display {
    background: var(--success);
    color: white;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
}

.row-total {
    font-weight: 600;
    color: var(--accent);
}

/* نظام الإشعارات المحسن */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    width: 350px;
}

.notification {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    margin-bottom: 15px;
    padding: 20px;
    transform: translateX(400px);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 5px solid;
    position: relative;
    overflow: hidden;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left-color: var(--success);
}

.notification.error {
    border-left-color: var(--danger);
}

.notification.warning {
    border-left-color: var(--warning);
}

.notification.info {
    border-left-color: var(--info);
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

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

.notification.success .notification-icon {
    background: var(--success);
}

.notification.error .notification-icon {
    background: var(--danger);
}

.notification.warning .notification-icon {
    background: var(--warning);
}

.notification.info .notification-icon {
    background: var(--info);
}

.notification-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2c3e50;
    flex: 1;
}

.notification-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #95a5a6;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.notification-close:hover {
    background: #ecf0f1;
    color: #7f8c8d;
}

.notification-message {
    color: #5a6c7d;
    font-size: 0.95rem;
    line-height: 1.4;
}

.notification-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0,0,0,0.1);
    border-radius: 0 0 12px 12px;
    transition: width linear;
}

.notification.success .notification-progress {
    background: var(--success);
}

.notification.error .notification-progress {
    background: var(--danger);
}

.notification.warning .notification-progress {
    background: var(--warning);
}

.notification.info .notification-progress {
    background: var(--info);
}

@media (max-width: 480px) {
    .notification-container {
        right: 10px;
        left: 10px;
        width: auto;
    }
    
    .notification {
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}

/* تنسيقات إضافية للموردين */
.text-muted {
    color: #6c757d !important;
}

.text-decoration-none {
    text-decoration: none !important;
}

.text-decoration-none:hover {
    text-decoration: underline !important;
}

code {
    background-color: #f8f9fa;
    color: #e83e8c;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}

.form-label i {
    margin-left: 8px;
    color: var(--accent);
}

.card-title i {
    margin-left: 10px;
    color: var(--accent);
}

.btn i {
    margin-left: 5px;
}

/* تنسيقات عرض الفاتورة */
.invoice-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.info-item {
    margin-bottom: 10px;
}

.info-item label {
    font-weight: 600;
    color: #495057;
    margin-left: 8px;
}

.info-item span {
    color: #212529;
}

.total-row {
    background-color: #e9ecef !important;
    font-weight: bold;
}

/* تنسيقات التصدير */
.export-wrapper {
    display: none;
}

.invoice-page {
    border: 1px solid #000;
    padding: 16px;
    background: #fff;
    font-family: "Rubik", Tahoma, Arial, sans-serif;
}

.invoice-page table {
    width: 100%;
    border-collapse: collapse;
}

.invoice-page .masthead-table thead th {
    background: #f2f6ff;
    text-align: center;
    padding: 10px;
    border: 1px solid #000;
    width: 33.33%;
    vertical-align: middle;
}

.invoice-page .title-brand {
    font-size: 20px;
    font-weight: 700;
    text-align: left;
}

.invoice-page .title-doc {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

.invoice-page .logo-cell {
    text-align: right;
}

.invoice-page .logo-cell img {
    max-height: 80px;
    max-width: 100%;
    object-fit: contain;
}

.invoice-page .head-info-table td {
    border: 1px solid #000;
    padding: 8px;
}

.invoice-page .head-info-table .pair {
    text-align: right;
}

.invoice-page .head-info-table .label {
    font-weight: 700;
    white-space: nowrap;
}

.invoice-page .head-info-table .label::after {
    content: ": ";
}

.invoice-page .export-table th,
.invoice-page .export-table td {
    border: 1px solid #000;
    padding: 8px;
    text-align: center;
}

.invoice-page .export-table thead th {
    background: #f2f6ff;
    font-weight: bold;
}

.invoice-page .developer-credit {
    margin-top: 20px;
    border-top: 1px solid #eee;
    padding-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #666;
}

@media print {
    .export-wrapper {
        display: block !important;
    }
    
    .navbar, .card-header, .btn {
        display: none !important;
    }
    
    .invoice-page .developer-credit {
        display: none !important;
    }
}

/* تنسيقات الرسائل المحسنة */
.message-box {
    margin: 20px 0;
    border-radius: 8px;
    border: 1px solid;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.message-content {
    display: flex;
    align-items: flex-start;
    padding: 16px;
    gap: 12px;
}

.message-icon {
    font-size: 24px;
    margin-top: 2px;
    flex-shrink: 0;
}

.message-text {
    flex: 1;
}

.message-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.message-details {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 8px;
}

.message-error-details {
    font-size: 13px;
    padding: 8px 12px;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
    margin-top: 8px;
    border-right: 3px solid currentColor;
}

/* ألوان الرسائل */
.message-success {
    background: #f0f9f4;
    border-color: #10b981;
    color: #065f46;
}

.message-success .message-icon {
    color: #10b981;
}

.message-error {
    background: #fef2f2;
    border-color: #ef4444;
    color: #991b1b;
}

.message-error .message-icon {
    color: #ef4444;
}

.message-warning {
    background: #fffbeb;
    border-color: #f59e0b;
    color: #92400e;
}

.message-warning .message-icon {
    color: #f59e0b;
}

.message-info {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

.message-info .message-icon {
    color: #3b82f6;
}

/* إخفاء الرسائل القديمة */
.alert {
    display: none !important;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.modal-header h2 {
    color: #f59e0b;
    margin-bottom: 20px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.modal-body p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    color: #2c3e50;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-footer .btn {
    min-width: 150px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.modal-footer .btn-primary {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.modal-footer .btn-primary:hover {
    background: #218838;
    border-color: #218838;
}

.modal-footer .btn-secondary {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
}

.modal-footer .btn-secondary:hover {
    background: #545b62;
    border-color: #545b62;
}

/* ✅ إظهار الأرقام بالإنجليزية */
input[type="number"] {
    font-family: 'Courier New', monospace;
    direction: ltr;
    text-align: center;
}

/* النتائج التلقائية للبحث */
.autocomplete-results,
.destination-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 10px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.autocomplete-item:hover {
    background: #f8f9fa;
}

.autocomplete-item.selected {
    background: #007bff !important;
    color: #fff !important;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item strong {
    color: inherit;
    font-weight: 600;
}

.autocomplete-item.selected strong {
    color: #fff !important;
}

.autocomplete-item small {
    color: #6c757d;
    font-size: 12px;
}

.autocomplete-item .text-muted {
    color: #28a745 !important;
    font-weight: 500;
}

/* تحسين عرض المخزون */
.stock-cell {
    text-align: center;
    font-weight: 600;
    color: #28a745;
    transition: all 0.3s ease;
}

.stock-display {
    display: inline-block;
    padding: 4px 10px;
    background: #d4edda;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

/* تنبيه تجاوز المخزون */
.stock-cell.stock-warning {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    animation: pulse-warning 1s ease-in-out;
}

.stock-display.stock-warning {
    background-color: #f5c6cb !important;
    border: 3px solid #dc3545 !important;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.5);
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* تنسيق الحقول في جدول النقل المتعدد */
.product-search {
    position: relative;
}

#products-table td {
    position: relative;
}

#products-table input[type="number"]:disabled {
    background-color: #e9ecef !important;
    cursor: not-allowed;
}

/* تنسيق للصفوف المكررة */
#products-tbody tr.duplicate-warning {
    background-color: #fff3cd !important;
}

/* تحسينات للطباعة */
@media print {
    body {
        background: white;
    }
    
    .navbar {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .modal {
        display: none !important;
    }
    
    .autocomplete-results {
        display: none !important;
    }
}
