/* تنسيقات لصفحات المشتريات للأجهزة المحمولة */

.mobile-purchases-page,
.mobile-purchases-create-page,
.mobile-purchases-details-page {
    padding: 0;
    max-width: 100%;
    margin: 0 auto;
}

.inventory-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 0.5rem;
    color: #333;
}

.invoice-number {
    font-size: 0.9rem;
    color: #6c757d;
    text-align: center;
    margin-bottom: 1rem;
}

/* تنسيق البطاقة الإحصائية */
.inventory-stats {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 20px;
    padding: 0 5px;
}

.stat-card {
    flex: 1;
    background-color: #fff;
    border-radius: 8px;
    padding: 12px 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c7be5;
}

.stat-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 5px;
}

/* تنسيق زر الإضافة */
.add-button-container {
    margin-bottom: 20px;
    padding: 0 5px;
}

.mobile-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    border: none;
}

.mobile-btn i {
    font-size: 0.9rem;
}

.mobile-btn-primary {
    background-color: #2c7be5;
    color: white;
    width: 100%;
}

.mobile-btn-primary:hover {
    background-color: #1a68d1;
    color: white;
}

.mobile-btn-outline {
    background-color: white;
    color: #495057;
    border: 1px solid #ced4da;
}

.mobile-btn-outline:hover {
    background-color: #f8f9fa;
    color: #212529;
}

.mobile-btn-danger {
    color: #dc3545;
    border-color: #dc3545;
}

.mobile-btn-danger:hover {
    background-color: #dc3545;
    color: white;
}

/* تنسيق بطاقة التفاصيل */
.details-card {
    background-color: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.details-card-header {
    padding: 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.details-card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.filters-container {
    display: flex;
    align-items: center;
}

.search-box {
    position: relative;
}

.search-input {
    padding: 8px 30px 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 20px;
    font-size: 0.9rem;
    width: 120px;
    transition: all 0.3s;
}

.search-input:focus {
    width: 160px;
    outline: none;
    border-color: #2c7be5;
}

.search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 0.9rem;
}

.details-card-body {
    padding: 15px;
}

/* تنسيق قائمة الفواتير */
.invoices-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.invoice-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: background-color 0.3s;
    text-decoration: none;
    color: inherit;
}

.invoice-item:hover {
    background-color: #e9ecef;
}

.invoice-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 12px;
    background-color: #fff;
    border-radius: 6px;
    padding: 5px;
    width: 50px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.invoice-day {
    font-size: 1.1rem;
    font-weight: 600;
    color: #343a40;
}

.invoice-month {
    font-size: 0.7rem;
    color: #6c757d;
    text-transform: uppercase;
}

.invoice-year {
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: 2px;
}

.invoice-details {
    flex: 1;
}

.invoice-supplier {
    font-weight: 500;
    margin-bottom: 5px;
    color: #212529;
}

.invoice-stats {
    display: flex;
    font-size: 0.9rem;
    color: #6c757d;
    gap: 15px;
}

.invoice-stats small {
    font-size: 0.75rem;
    color: #adb5bd;
}

.invoice-items {
    font-weight: 500;
}

.invoice-total {
    font-weight: 500;
    color: #2c7be5;
}

.invoice-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.invoice-id {
    font-size: 0.8rem;
    color: #6c757d;
    background-color: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
}

/* تنسيق عند عدم وجود بيانات */
.no-data {
    text-align: center;
    padding: 30px 20px;
    color: #6c757d;
}

.no-data-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #adb5bd;
}

.no-data .mobile-btn {
    margin-top: 15px;
    display: inline-flex;
}

/* تنسيق صفحة إنشاء الفاتورة */
.mobile-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem;
}

.mobile-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.mobile-input:focus {
    border-color: #2c7be5;
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 123, 229, 0.2);
}

/* تنسيق مدخل الكمية */
.quantity-input-container {
    display: flex;
    align-items: center;
    border: 1px solid #ced4da;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-btn {
    background-color: #f8f9fa;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 1rem;
    color: #495057;
}

.quantity-btn:active {
    background-color: #e9ecef;
}

#quantityInput {
    border: none;
    text-align: center;
    flex-grow: 1;
    padding: 10px 5px;
    margin: 0;
    border-radius: 0;
}

#quantityInput:focus {
    box-shadow: none;
}

/* تنسيق زر إضافة عنصر */
.add-item {
    background-color: #e9ecef;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-size: 0.9rem;
    color: #495057;
    transition: all 0.3s;
}

.add-item:hover {
    background-color: #2c7be5;
    color: white;
}

/* تنسيق قائمة العناصر */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.invoice-item .item-details {
    flex: 1;
}

.invoice-item .item-name {
    font-weight: 500;
    margin-bottom: 4px;
    color: #212529;
}

.invoice-item .item-metrics {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #6c757d;
}

.invoice-item .item-quantity {
    color: #495057;
}

.invoice-item .item-total {
    font-weight: 500;
    color: #2c7be5;
}

.invoice-item .item-actions {
    display: flex;
    gap: 5px;
}

.btn-action {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ced4da;
    background-color: white;
    font-size: 0.8rem;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s;
}

.edit-item:hover {
    color: #fd7e14;
    border-color: #fd7e14;
}

.delete-item:hover {
    color: #dc3545;
    border-color: #dc3545;
}

/* تنسيق ملخص الفاتورة */
.invoice-summary {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}

.summary-item, .summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.summary-label {
    font-size: 0.9rem;
    color: #495057;
}

.summary-value {
    font-size: 0.9rem;
    font-weight: 500;
    color: #212529;
}

.summary-item.total, .summary-row.total {
    border-top: 1px solid #e9ecef;
    padding-top: 10px;
    margin-top: 10px;
}

.summary-item.total .summary-value, 
.summary-row.total .summary-value,
.total-value {
    color: #2c7be5;
    font-weight: 600;
    font-size: 1.1rem;
}

.empty-items-message {
    text-align: center;
    padding: 30px 0;
    color: #6c757d;
}

.form-actions {
    margin-top: 30px;
    margin-bottom: 30px;
}

/* تنسيق المودال */
.mobile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    padding: 15px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

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

.modal-content {
    background-color: #fff;
    border-radius: 8px;
    max-width: 100%;
    width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.3s;
}

.mobile-modal.active .modal-content {
    transform: translateY(0);
}

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

.modal-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-close {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
}

.btn-close::before {
    content: "×";
}

.modal-body {
    padding: 15px;
}

.modal-footer {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.mb-3 {
    margin-bottom: 15px;
}

.total-cost {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c7be5;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

/* تنسيق صفحة تفاصيل الفاتورة */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item.full-width {
    grid-column: span 2;
}

.info-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.info-value {
    font-size: 1rem;
    font-weight: 500;
    color: #212529;
}

.invoice-items-list {
    margin-bottom: 20px;
}

.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 30px;
}

/* تنسيق رسائل الإشعارات */
.toast-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 1060;
    background-color: #fff;
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    font-size: 0.9rem;
    opacity: 0;
    transition: all 0.3s;
    min-width: 250px;
    max-width: 90%;
    text-align: center;
}

.toast-message.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-success {
    background-color: #d4edda;
    border-left: 5px solid #28a745;
    color: #155724;
}

.toast-error {
    background-color: #f8d7da;
    border-left: 5px solid #dc3545;
    color: #721c24;
}

.toast-warning {
    background-color: #fff3cd;
    border-left: 5px solid #ffc107;
    color: #856404;
}

/* تنسيقات استجابية */
@media (max-width: 480px) {
    .mobile-input, .quantity-btn {
        padding: 10px 12px;
    }
    
    .invoice-item {
        padding: 10px;
    }
    
    .invoice-date {
        width: 45px;
        margin-left: 8px;
    }
    
    .invoice-day {
        font-size: 1rem;
    }
    
    .invoice-supplier {
        font-size: 0.95rem;
    }
    
    .info-grid {
        gap: 10px;
    }
}

/* تنسيق للشاشة عند وجود مودال مفتوح */
body.modal-open {
    overflow: hidden;
}
