/* تنسيقات مخصصة لنظام إدارة مبيعات الأدوات الكهربائية */

:root {
    --primary-color: #007bff;
    --secondary-color: #0056b3;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --info-color: #17a2b8;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    direction: rtl;
}

/* شريط التنقل */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
    color: white !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    color: rgba(255, 255, 255, 0.9) !important;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white !important;
}

.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white !important;
}

/* البطاقات */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 10px 10px 0 0 !important;
    font-weight: bold;
}

/* الأزرار */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #20c997);
    border: none;
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color), #fd7e14);
    border: none;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #c82333);
    border: none;
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color), #138496);
    border: none;
}

/* الجداول */
.table {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    font-weight: bold;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.1);
    transform: scale(1.01);
}

/* النماذج */
.form-control, .form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
}

/* الإحصائيات */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* إشعارات */
.alert {
    border-radius: 10px;
    border: none;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #f39c12, #f1c40f);
    color: white;
}

.alert-info {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

/* شريط التقدم */
.progress {
    height: 10px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.2);
}

.progress-bar {
    border-radius: 10px;
    transition: width 0.6s ease;
}

/* الأيقونات */
.icon-large {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.icon-medium {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* التحميل */
.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); }
}

/* التجاوب */
@media (max-width: 768px) {
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .btn-group-vertical .btn {
        margin-bottom: 0.5rem;
    }
}

/* تنسيقات خاصة للفواتير */
.invoice-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    border-radius: 10px 10px 0 0;
}

.invoice-body {
    background: white;
    padding: 2rem;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.invoice-total {
    background: linear-gradient(135deg, var(--light-color), #e9ecef);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.invoice-item {
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 0;
}

.invoice-item:last-child {
    border-bottom: none;
}

/* تنسيقات التقارير */
.report-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.report-header {
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.report-title {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.5rem;
}

.report-summary {
    background: linear-gradient(135deg, var(--light-color), #e9ecef);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 5px solid var(--primary-color);
}

/* تنسيقات خاصة للبحث */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-right: 3rem;
}

.search-box .search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

/* تنسيقات خاصة للفلترة */
.filter-section {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 2rem;
}

/* تنسيقات الشارات */
.badge {
    font-weight: 500;
    padding: 0.5em 0.75em;
}

.bg-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
}

.bg-success {
    background: linear-gradient(135deg, var(--success-color), #20c997) !important;
}

.bg-warning {
    background: linear-gradient(135deg, var(--warning-color), #fd7e14) !important;
    color: #212529 !important;
}

.bg-danger {
    background: linear-gradient(135deg, var(--danger-color), #c82333) !important;
}

.bg-info {
    background: linear-gradient(135deg, var(--info-color), #138496) !important;
}

/* تنسيقات التنبيهات */
.alert {
    border: none;
    border-radius: 10px;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1), rgba(32, 201, 151, 0.1));
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(200, 35, 51, 0.1));
    color: var(--danger-color);
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(253, 126, 20, 0.1));
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1), rgba(19, 132, 150, 0.1));
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

.alert-primary {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 86, 179, 0.1));
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

/* تنسيقات النماذج */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.input-group-text {
    background: linear-gradient(135deg, var(--light-color), #e9ecef);
    border-color: #ced4da;
    color: var(--dark-color);
}

/* تنسيقات القوائم المنسدلة */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
}

.dropdown-item:hover {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 86, 179, 0.1));
    color: var(--primary-color);
}

.dropdown-item:active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

/* تنسيقات الإحصائيات */
.stat-card {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.stat-icon.success {
    background: linear-gradient(135deg, var(--success-color), #20c997);
}

.stat-icon.warning {
    background: linear-gradient(135deg, var(--warning-color), #fd7e14);
}

.stat-icon.danger {
    background: linear-gradient(135deg, var(--danger-color), #c82333);
}

.stat-icon.info {
    background: linear-gradient(135deg, var(--info-color), #138496);
}

/* تنسيقات خاصة للصفحات */
.page-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: 0 0 20px 20px;
}

.page-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* تنسيقات خاصة للتحميل */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* تنسيقات خاصة للطباعة */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-break {
        page-break-before: always;
    }
    
    body {
        background: white !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}

/* تنسيقات خاصة لشبكة المنتجات */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-item {
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.product-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.2);
}

.product-item .card-body {
    padding: 1rem;
}

.product-item .btn {
    transition: all 0.3s ease;
}

.product-item .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* تأثيرات بصرية للبحث */
.product-card.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* تنسيقات خاصة للكمية */
.input-group .btn {
    border-radius: 0;
}

.input-group .form-control {
    border-radius: 0;
    text-align: center;
    font-weight: bold;
}

/* تنسيقات خاصة للشبكة */
#products-grid {
    min-height: 400px;
}

.product-card[style*="display: none"] {
    display: none !important;
}

/* رسائل الحالة */
.stock-status {
    font-size: 0.8rem;
    font-weight: bold;
}

.stock-available {
    color: var(--success-color);
}

.stock-low {
    color: var(--warning-color);
}

.stock-out {
    color: var(--danger-color);
}

/* تأثيرات الحركة */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: slideIn 0.5s ease-out;
}

/* تنسيقات خاصة للبحث */
#product_search {
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.35-4.35"></path></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    padding-right: 40px;
}

/* تنسيقات خاصة للفلترة */
.filter-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #dee2e6;
}

/* تنسيقات خاصة للبطاقات */
.product-item .card-title {
    font-size: 0.9rem;
    line-height: 1.3;
    height: 2.6rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-item .card-text {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.product-item .h5 {
    font-size: 1.1rem;
    font-weight: bold;
}

/* تنسيقات خاصة للأزرار */
.product-item .btn-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
    border: none;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-item .btn-primary:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
}

/* تنسيقات خاصة للشبكة المتجاوبة */
@media (max-width: 768px) {
    .product-card {
        margin-bottom: 1rem;
    }
    
    .product-item .card-body {
        padding: 0.75rem;
    }
    
    .product-item .card-title {
        font-size: 0.8rem;
        height: 2rem;
    }
    
    .product-item .h5 {
        font-size: 1rem;
    }
}

/* تنسيقات صور المنتجات */
.product-item img {
    transition: transform 0.3s ease;
    border-radius: 8px;
}

.product-item:hover img {
    transform: scale(1.05);
}

.product-item .card-body {
    padding: 1rem;
}

.product-item .card-title {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
    min-height: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-item .price {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--success-color);
}

.product-item .stock-info {
    font-size: 0.8rem;
}

.product-item .stock-info .badge {
    font-size: 0.75rem;
}

/* تحسين مظهر الصور في الجدول */
.table img {
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.table img:hover {
    transform: scale(1.1);
    z-index: 10;
    position: relative;
}

/* تنسيقات خاصة لصفحة المنتجات */
.products-table img {
    border: 2px solid #e9ecef;
}

.products-table img:hover {
    border-color: #007bff;
}

/* تنسيقات إضافية للطباعة */
@media print {
    .btn, .navbar, .sidebar, .page-header, .card-header {
        display: none !important;
    }
    
    .card {
        border: none !important;
        box-shadow: none !important;
    }
    
    body {
        font-size: 12px !important;
    }
}

/* تنسيقات موحدة إضافية */
.pagination .page-link {
    color: var(--primary-color);
    border-color: #dee2e6;
}

.pagination .page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.progress-bar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.list-group-item.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
}

.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-color: var(--primary-color);
    color: white;
}

.nav-tabs .nav-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ============================================
   تنسيقات RTL للفواتير
   ============================================ */

/* تنسيقات خاصة للفواتير بتخطيط RTL */
.invoice-rtl {
    direction: rtl;
    text-align: right;
}

.invoice-rtl * {
    direction: rtl;
}

/* تنسيقات رأس الفاتورة RTL */
.invoice-header-rtl {
    border-bottom: 2px solid var(--primary-color);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 10px 10px 0 0;
}

.invoice-header-rtl .invoice-logo {
    text-align: left;
    float: left;
}

.invoice-header-rtl .invoice-info {
    text-align: right;
    float: right;
}

/* تنسيقات جسم الفاتورة RTL */
.invoice-body-rtl {
    padding: 1.5rem;
}

.invoice-body-rtl .customer-info,
.invoice-body-rtl .payment-info {
    direction: rtl;
    text-align: right;
}

/* تنسيقات الجدول في الفاتورة RTL */
.invoice-table-rtl {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    direction: rtl;
}

.invoice-table-rtl th {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.75rem;
    text-align: right;
    border: 1px solid #dee2e6;
    font-weight: bold;
}

.invoice-table-rtl td {
    padding: 0.75rem;
    text-align: right;
    border: 1px solid #dee2e6;
}

.invoice-table-rtl tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.invoice-table-rtl tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.1);
}

/* تنسيقات المجاميع RTL */
.invoice-totals-rtl {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 5px solid var(--primary-color);
    margin-top: 1.5rem;
    direction: rtl;
    text-align: right;
}

.invoice-totals-rtl .total-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #dee2e6;
}

.invoice-totals-rtl .total-row:last-child {
    border-bottom: none;
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--success-color);
}

.invoice-totals-rtl .total-label {
    font-weight: 600;
    color: var(--dark-color);
}

.invoice-totals-rtl .total-value {
    font-weight: bold;
    color: var(--primary-color);
}

/* تنسيقات التوقيعات RTL */
.invoice-signatures-rtl {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #dee2e6;
    direction: rtl;
}

.invoice-signatures-rtl .signature-box {
    text-align: center;
    width: 48%;
}

.invoice-signatures-rtl .signature-line {
    border-top: 2px solid var(--dark-color);
    padding-top: 0.5rem;
    margin-top: 2rem;
    font-weight: bold;
}

/* ============================================================
   نموذج فاتورة Recept
   ============================================================ */
.invoice-recept-body {
    font-family: "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
    background: linear-gradient(135deg, #0f172a, #1e293b);
    min-height: 100vh;
    padding-bottom: 4rem;
}

.invoice-toolbar {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    color: #e2e8f0;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.45);
}

.invoice-toolbar .toolbar-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.invoice-toolbar .toolbar-brand {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.invoice-toolbar .toolbar-brand i {
    font-size: 1.4rem;
    color: var(--warning-color);
}

.invoice-toolbar .toolbar-actions {
    display: flex;
    gap: 0.75rem;
}

.invoice-toolbar .btn {
    border-radius: 999px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
}

.invoice-recept-wrapper {
    padding: 3rem 1rem;
    display: flex;
    justify-content: center;
}

.invoice-sheet {
    background: #ffffff;
    width: min(900px, 100%);
    border-radius: 24px;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    position: relative;
}

.invoice-sheet .invoice-draft-watermark {
    font-size: 4.5rem;
    opacity: 0.07;
}

.recept-header {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.92), rgba(15, 118, 110, 0.92));
    color: #f8fafc;
    padding: 2.5rem 2.25rem;
    border-radius: 24px 24px 0 0;
    position: relative;
    overflow: hidden;
}

.recept-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.25), transparent 55%);
    pointer-events: none;
}

.recept-brand-box {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.recept-logo {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25);
}

.recept-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recept-logo i {
    font-size: 2.5rem;
}

.recept-brand-info h1 {
    font-size: 1.7rem;
    margin: 0;
    font-weight: 800;
}

.recept-brand-info p {
    margin: 0.35rem 0 0;
    color: rgba(226, 232, 240, 0.85);
    font-weight: 500;
}

.recept-company-meta {
    background: rgba(15, 23, 42, 0.18);
    border-radius: 20px;
    padding: 1.25rem 1.5rem;
    backdrop-filter: blur(6px);
    position: relative;
    z-index: 1;
    font-weight: 500;
    display: grid;
    gap: 0.5rem;
}

.recept-company-meta .meta-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.recept-company-meta .meta-label {
    color: rgba(226, 232, 240, 0.75);
    min-width: 110px;
}

.recept-company-meta a {
    color: #f8fafc;
    text-decoration: none;
}

.recept-body {
    padding: 2.5rem 2.25rem 2rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.info-card {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.2);
    overflow: hidden;
}

.info-card-header {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(8, 145, 178, 0.2));
    padding: 1rem 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #0f172a;
}

.info-card-body {
    padding: 1.2rem 1.5rem;
    display: grid;
    gap: 0.65rem;
    font-weight: 500;
}

.info-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.info-label {
    width: 120px;
    color: #64748b;
    font-weight: 600;
}

.invoice-table-rtl.recept-table thead th {
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.9), rgba(8, 145, 178, 0.85));
    color: #f8fafc;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
}

.invoice-table-rtl.recept-table tbody td {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.35);
    font-weight: 500;
}

.invoice-table-rtl.recept-table tbody tr:nth-child(even) td {
    background: #f8fafc;
}

.invoice-table-rtl.recept-table tbody tr:hover td {
    background: rgba(2, 132, 199, 0.08);
}

.recept-totals {
    background: linear-gradient(180deg, #f1f5f9 0%, #ffffff 100%);
    padding: 2rem 2.25rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.totals-card,
.payment-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    padding: 1.5rem;
}

.totals-card .total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.45);
    padding: 0.75rem 0;
}

.totals-card .total-row:last-child {
    border-bottom: none;
}

.totals-card .total-row-grand .total-value {
    color: #0f766e;
}

.payment-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #0f172a;
}

.payment-card-body {
    display: grid;
    gap: 0.65rem;
    font-weight: 500;
}

.recept-signatures {
    padding: 2rem 2.25rem 2.5rem;
    gap: 1.5rem;
}

.signature-box {
    background: #ffffff;
    border-radius: 18px;
    border: 1px dashed rgba(15, 118, 110, 0.35);
    padding: 1.75rem;
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.15);
}

.signature-title {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.25rem;
}

.signature-name {
    margin-top: 1rem;
    color: #0f766e;
    font-weight: 600;
}

.signature-stamp {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px;
}

.stamp-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 3px solid rgba(14, 165, 233, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-weight: 700;
    color: #0f172a;
    text-align: center;
    padding: 0 1rem;
    text-transform: uppercase;
    position: relative;
}

.stamp-circle::after {
    content: "";
    position: absolute;
    inset: 10px;
    border: 2px dashed rgba(14, 165, 233, 0.45);
    border-radius: 50%;
}

.stamp-circle small {
    font-size: 0.75rem;
    color: #0f766e;
    text-transform: none;
}

.recept-notes {
    padding: 0 2.25rem 2.5rem;
}

.notes-card {
    background: #ffffff;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.notes-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    font-weight: 700;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.4);
    color: #0f172a;
    background: rgba(2, 132, 199, 0.08);
}

.notes-list {
    margin: 0;
    padding: 1.25rem 2rem;
    list-style: disc inside;
    display: grid;
    gap: 0.5rem;
    color: #475569;
    font-weight: 500;
}

.notes-list li::marker {
    color: #0f766e;
}

@media (max-width: 767.98px) {
    .invoice-toolbar .toolbar-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .invoice-toolbar .toolbar-actions {
        flex-direction: column;
    }

    .invoice-toolbar .btn {
        width: 100%;
        justify-content: center;
    }

    .invoice-sheet {
        border-radius: 18px;
    }

    .recept-header,
    .recept-body,
    .recept-totals,
    .recept-signatures,
    .recept-notes {
        padding: 1.75rem 1.25rem;
    }

    .info-label {
        width: 100%;
    }

    .recept-company-meta {
        font-size: 0.95rem;
    }

    .signature-box {
        width: 100%;
    }

    .invoice-signatures-rtl {
        flex-direction: column;
    }
}

/* تنسيقات المسودة */
.invoice-draft-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, var(--warning-color), #fd7e14);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.invoice-draft-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 5rem;
    font-weight: bold;
    color: rgba(255, 193, 7, 0.2);
    pointer-events: none;
    z-index: 1;
}

/* تنسيقات الطباعة RTL */
@media print {
    @page {
        size: A4;
        margin: 10mm;
    }
    
    body {
        direction: rtl !important;
    }
    
    * {
        direction: rtl !important;
        text-align: right !important;
    }
    
    .invoice-rtl {
        direction: rtl !important;
        page-break-inside: avoid;
    }
    
    .invoice-header-rtl {
        page-break-after: avoid;
    }
    
    .invoice-table-rtl {
        page-break-inside: avoid;
    }
    
    .invoice-totals-rtl {
        page-break-inside: avoid;
    }
    
    .invoice-signatures-rtl {
        page-break-inside: avoid;
    }
    
    .no-print {
        display: none !important;
    }
    
    /* تبسيط الألوان للطباعة */
    .invoice-table-rtl th {
        background-color: #333 !important;
        color: white !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .invoice-recept-body {
        background: #ffffff !important;
        padding: 0 !important;
    }

    .invoice-toolbar {
        display: none !important;
    }

    .invoice-sheet {
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .recept-header {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .invoice-sheet .invoice-draft-watermark {
        opacity: 0.05 !important;
    }

    .signature-box {
        box-shadow: none !important;
    }

    .notes-card,
    .payment-card,
    .totals-card {
        box-shadow: none !important;
    }
}

/* تنسيقات نسبة الربح */
.profit-margin-input {
    display: flex;
    align-items: center;
    direction: rtl;
}

.profit-margin-input input {
    max-width: 150px;
}

.profit-margin-badge {
    background: linear-gradient(135deg, var(--success-color), #20c997);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-right: 0.5rem;
}

/* تنسيقات الفواتير المبدئية في الجدول */
.table-draft-row {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

.table-draft-row:hover {
    background-color: rgba(255, 193, 7, 0.2) !important;
}

.draft-status-badge {
    background: linear-gradient(135deg, var(--warning-color), #fd7e14);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}