@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100;200;300;400;500;600;700;800;900&display=swap');

/**
 * استایل‌های فرانت‌اند پلاگین Factorin
 * فرم صدور فاکتور آنلاین
 */

/* ========================================
   پیشنمایش محصول حرفه‌ای - اولویت بالا
   ======================================== */

.factorin-product-preview {
    max-width: 1200px;
    margin: 0 auto;
    font-family: "Vazirmatn", "Vazir", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif !important;
    font-weight: 600 !important;
    direction: rtl;
    text-align: right;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: block !important;
    visibility: visible !important;
}

/* هدر پیشنمایش محصول */
.product-preview-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    padding: 60px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.product-preview-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    pointer-events: none;
}



.header-content {
    position: relative;
    z-index: 2;
}

.product-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 25px;
    margin-bottom: 20px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.badge-icon {
    font-size: 1.2rem;
}

.badge-text {
    font-size: 0.9rem;
    font-weight: 600;
}

.product-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0 0 20px 0;
    color: #ffffff;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.product-subtitle {
    font-size: 1.3rem;
    margin: 0 0 30px 0;
    opacity: 0.9;
    color: #ffffff;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.product-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.price-currency {
    font-size: 1.2rem;
    opacity: 0.8;
    color: #ffffff;
}

.header-actions {
    position: relative;
    z-index: 2;
}

.btn-buy-now {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    text-decoration: none;
}

.btn-buy-now:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.btn-icon {
    font-size: 1.3rem;
}

/* Reset و تنظیمات پایه */
.factorin-frontend-container * {
    box-sizing: border-box;
}

.factorin-frontend-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Vazir', 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
    text-align: right;
    background: #f8f9fa;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* هدر */
.factorin-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
}

.factorin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
}

.factorin-header h2 {
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    flex: 1;
}

/* کنترل‌های هدر */
.factorin-header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* وضعیت کاربر */
.factorin-user-status {
    display: flex;
    align-items: center;
}

.user-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.user-status.logged-in {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.user-status.guest {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}



/* فرم - کامپکت */
.factorin-form {
    background: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* بخش‌ها - فوق‌العاده کامپکت */
.factorin-section {
    margin-bottom: 8px;
    padding: 8px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background: #fafbfc;
}

.factorin-section h3 {
    margin: 0 0 8px 0;
    color: #495057;
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 2px solid #667eea;
    padding-bottom: 4px;
}

/* ردیف‌ها و ستون‌ها - فوق‌العاده کامپکت */
.factorin-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 6px;
    margin-bottom: 6px;
}

.factorin-col {
    min-width: 0;
    position: relative;
}

/* برچسب‌ها - خیلی کوچک */
.factorin-col label {
    display: block;
    margin-bottom: 3px;
    font-weight: 500;
    color: #495057;
    font-size: 0.8rem;
}

/* فیلدهای ورودی - فوق‌العاده کامپکت */
.factorin-col input,
.factorin-col select,
.factorin-col textarea {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #e9ecef;
    border-radius: 3px;
    font-size: 0.8rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    height: 32px;
}

.factorin-col input:focus,
.factorin-col select:focus,
.factorin-col textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.factorin-col input:invalid {
    border-color: #dc3545;
}

.factorin-col input:valid {
    border-color: #28a745;
}

/* استایل برای فیلد تاریخ فاکتور */
#invoice_date_shamsi {
    border: 2px solid #007cba !important;
    background: #f8f9fa !important;
    font-weight: 500;
}

#invoice_date_shamsi:focus {
    border-color: #005a87 !important;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1) !important;
    outline: none;
}

#invoice_date_shamsi.error {
    border-color: #dc3545 !important;
    background: #fff5f5 !important;
}

#invoice_date_shamsi.success {
    border-color: #28a745 !important;
    background: #f8fff8 !important;
}

.factorin-col .description {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

/* استایل برای فیلد تاریخ فاکتور در بخش دمو */
#demo-invoice-date-shamsi {
    border: 2px solid #007cba !important;
    background: #f8f9fa !important;
    font-weight: 500;
}

#demo-invoice-date-shamsi:focus {
    border-color: #005a87 !important;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1) !important;
    outline: none;
}

#demo-invoice-date-shamsi.error {
    border-color: #dc3545 !important;
    background: #fff5f5 !important;
}

#demo-invoice-date-shamsi.success {
    border-color: #28a745 !important;
    background: #f8fff8 !important;
}

.demo-form .description {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

/* textarea جداگانه */
.factorin-col textarea {
    height: auto;
    min-height: 32px;
    max-height: 60px;
    resize: vertical;
}

/* تولتیپ و پاپ‌آپ */
.factorin-tooltip {
    position: relative;
    display: inline-block;
}

.factorin-tooltip .tooltip-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 10px;
    cursor: help;
    margin-right: 4px;
    vertical-align: middle;
}

.factorin-tooltip .tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 1000;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    max-width: 200px;
    white-space: normal;
}

.factorin-tooltip .tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.factorin-tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* پاپ‌آپ زیبا */
.factorin-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.factorin-popup.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.factorin-popup-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    position: relative;
}

.factorin-popup-close {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.factorin-popup-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.factorin-popup-body {
    color: #666;
    line-height: 1.5;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* آیتم محصول - کامپکت */
.product-item {
    background: white;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
    position: relative;
}

.product-item .factorin-row {
    margin-bottom: 0;
}

/* دکمه حذف محصول */
.product-item .remove-product {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.product-item .remove-product:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* دکمه‌ها - کوچک */
.factorin-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: inherit;
}

.factorin-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.factorin-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.factorin-btn-secondary {
    background: #6c757d;
    color: white;
}

.factorin-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.factorin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* خلاصه فاکتور */
.factorin-summary {
    background: white;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f3f4;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-row.total {
    font-weight: 700;
    font-size: 1.1rem;
    color: #495057;
    background: #f8f9fa;
    margin: 10px -20px -20px -20px;
    padding: 15px 20px;
    border-radius: 0 0 6px 6px;
}

/* عملیات */
.factorin-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

/* داشبورد فرانت */
.fd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 20px 0 10px;
}

.fd-card {
    display: block;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 18px;
    text-decoration: none;
    color: inherit;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}

.fd-card:hover { transform: translateY(-4px); box-shadow: 0 8px 22px rgba(0,0,0,.08); }

.fd-icon { font-size: 28px; margin-bottom: 10px; }
.fd-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 6px; }
.fd-desc { color: #6c757d; font-size: .9rem; }

.fd-sections { margin-top: 22px; }
.fd-list .fd-item { padding: 12px 10px; border-bottom: 1px solid #f1f3f4; }
.fd-item-title { font-weight: 600; margin-bottom: 4px; }
.fd-item-sub { color: #6c757d; font-size: .9rem; }

/* تم تاریک برای داشبورد */
.factorin-frontend-container[data-theme="dark"] .fd-card { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); }
.factorin-frontend-container[data-theme="dark"] .fd-desc { color: #cfd3d7; }
.factorin-frontend-container[data-theme="dark"] .fd-list .fd-item { border-bottom-color: rgba(255,255,255,.12); }

/* پیام‌ها */
.factorin-messages {
    margin-top: 20px;
}

.factorin-message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
    font-weight: 500;
}

.factorin-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.factorin-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.factorin-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* اعلان دمو */
.factorin-demo-notice {
    background: #fff3cd;
    color: #856404;
    padding: 20px;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    text-align: center;
    font-weight: 500;
    margin: 20px 0;
}

/* انیمیشن‌ها */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.factorin-section {
    animation: fadeIn 0.5s ease-out;
}

/* لودینگ */
.factorin-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* استایل‌های ورودی و تاریخ */
.factorin-date-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
}

.input-group button {
    white-space: nowrap;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .factorin-frontend-container {
        padding: 15px;
        margin: 10px;
        width: auto;
        max-width: 100%;
        overflow-x: hidden;
    }
    
    .factorin-form {
        padding: 15px;
    }
    
    .factorin-row {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .factorin-col {
        min-width: 100%;
        width: 100%;
        margin-bottom: 5px;
    }

    .factorin-col input,
    .factorin-col select,
    .factorin-col textarea {
        max-width: 100%;
        width: 100%;
    }
    
    .factorin-actions {
        flex-direction: column;
        gap: 10px;
    }

    .factorin-actions button {
        width: 100%;
        justify-content: center;
    }
    
    .factorin-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }
    
    .factorin-header h2 {
        font-size: 1.4rem;
        margin-bottom: 10px;
        width: 100%;
        text-align: center;
    }

    .factorin-header-controls {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .theme-toggle-btn {
        min-width: auto;
        padding: 8px 15px;
    }
    
    .theme-text {
        display: inline-block; /* Show text on mobile for better UX if space permits, or hide if crowded. User said 'atoms sticking out', so maybe keep compact */
        display: none;
    }
    
    .product-item .factorin-row {
        display: flex;
        flex-direction: column;
    }
    
    .product-item {
        padding-left: 45px; /* Space for remove button */
    }

    /* Fix for atoms/badges */
    .product-badge, .user-status {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .factorin-tooltip .tooltip-content {
        width: 200px;
        max-width: 80vw;
        left: 50%;
        transform: translateX(-50%);
        bottom: 130%;
    }

    .factorin-date-wrapper {
        flex-wrap: wrap;
    }
    
    .input-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .factorin-frontend-container {
        padding: 10px;
        margin: 5px;
    }
    
    .factorin-form {
        padding: 15px;
    }
    
    .factorin-section {
        padding: 15px;
    }
    
    .factorin-header {
        padding: 15px;
    }
    
    .factorin-header h2 {
        font-size: 1.3rem;
    }
}

/* تم‌های مختلف */
.factorin-frontend-container[data-theme="dark"] {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.factorin-frontend-container[data-theme="dark"] .factorin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.factorin-frontend-container[data-theme="dark"] .theme-toggle-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.25);
    color: white;
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
}

.factorin-frontend-container[data-theme="dark"] .theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.factorin-frontend-container[data-theme="dark"] .factorin-form {
    background: rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.factorin-frontend-container[data-theme="dark"] .factorin-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.factorin-frontend-container[data-theme="dark"] .factorin-section h3 {
    color: #667eea;
    border-bottom-color: #667eea;
}

.factorin-frontend-container[data-theme="dark"] .factorin-col label {
    color: #ffffff;
    font-weight: 500;
}

.factorin-frontend-container[data-theme="dark"] .factorin-col input,
.factorin-frontend-container[data-theme="dark"] .factorin-col select,
.factorin-frontend-container[data-theme="dark"] .factorin-col textarea {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.factorin-frontend-container[data-theme="dark"] .factorin-col input:focus,
.factorin-frontend-container[data-theme="dark"] .factorin-col select:focus,
.factorin-frontend-container[data-theme="dark"] .factorin-col textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    background: rgba(255, 255, 255, 0.12);
}

.factorin-frontend-container[data-theme="dark"] .factorin-col input::placeholder,
.factorin-frontend-container[data-theme="dark"] .factorin-col textarea::placeholder {
    color: #888;
}

/* استایل برای فیلد تاریخ فاکتور در تم تاریک */
.factorin-frontend-container[data-theme="dark"] #invoice_date_shamsi {
    border: 2px solid #4a9eff !important;
    background: rgba(74, 158, 255, 0.1) !important;
    color: #ffffff;
}

.factorin-frontend-container[data-theme="dark"] #invoice_date_shamsi:focus {
    border-color: #66b3ff !important;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2) !important;
}

.factorin-frontend-container[data-theme="dark"] #invoice_date_shamsi.error {
    border-color: #ff6b6b !important;
    background: rgba(255, 107, 107, 0.1) !important;
}

.factorin-frontend-container[data-theme="dark"] #invoice_date_shamsi.success {
    border-color: #51cf66 !important;
    background: rgba(81, 207, 102, 0.1) !important;
}

.factorin-frontend-container[data-theme="dark"] .factorin-col .description {
    color: #b8b8b8;
}

/* استایل برای فیلد تاریخ فاکتور در بخش دمو در تم تاریک */
.factorin-product-preview[data-theme="dark"] #demo-invoice-date-shamsi {
    border: 2px solid #4a9eff !important;
    background: rgba(74, 158, 255, 0.1) !important;
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] #demo-invoice-date-shamsi:focus {
    border-color: #66b3ff !important;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2) !important;
}

.factorin-product-preview[data-theme="dark"] #demo-invoice-date-shamsi.error {
    border-color: #ff6b6b !important;
    background: rgba(255, 107, 107, 0.1) !important;
}

.factorin-product-preview[data-theme="dark"] #demo-invoice-date-shamsi.success {
    border-color: #51cf66 !important;
    background: rgba(81, 207, 102, 0.1) !important;
}

.factorin-product-preview[data-theme="dark"] .demo-form .description {
    color: #b8b8b8;
}

.factorin-frontend-container[data-theme="dark"] .product-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.factorin-frontend-container[data-theme="dark"] .product-item .remove-product {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.3);
}

.factorin-frontend-container[data-theme="dark"] .product-item .remove-product:hover {
    background: linear-gradient(135deg, #ff5252, #d63031);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.factorin-frontend-container[data-theme="dark"] .factorin-summary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.factorin-frontend-container[data-theme="dark"] .summary-row {
    border-bottom-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.factorin-frontend-container[data-theme="dark"] .summary-row.total {
    background: rgba(102, 126, 234, 0.1);
    border-top-color: #667eea;
    color: #fff;
}

.factorin-frontend-container[data-theme="dark"] .factorin-btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.factorin-frontend-container[data-theme="dark"] .factorin-btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}

.factorin-frontend-container[data-theme="dark"] .factorin-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.factorin-frontend-container[data-theme="dark"] .factorin-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.factorin-frontend-container[data-theme="dark"] .factorin-actions {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.factorin-frontend-container[data-theme="dark"] .factorin-message.success {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.factorin-frontend-container[data-theme="dark"] .factorin-message.error {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.factorin-frontend-container[data-theme="dark"] .factorin-message.info {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.3);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.factorin-frontend-container[data-theme="dark"] .factorin-demo-notice {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.3);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

/* انیمیشن‌های اضافی برای تم تاریک */
.factorin-frontend-container[data-theme="dark"] .factorin-section {
    animation: darkFadeIn 0.6s ease-out;
}

@keyframes darkFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
        background: rgba(255, 255, 255, 0);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        background: rgba(255, 255, 255, 0.03);
    }
}

/* افکت شیشه‌ای برای تم تاریک */
.factorin-frontend-container[data-theme="dark"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    pointer-events: none;
    z-index: 1;
}

.factorin-frontend-container[data-theme="dark"] > * {
    position: relative;
    z-index: 2;
}

/* اسکرول بار سفارشی برای تم تاریک */
.factorin-frontend-container[data-theme="dark"]::-webkit-scrollbar {
    width: 8px;
}

.factorin-frontend-container[data-theme="dark"]::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.factorin-frontend-container[data-theme="dark"]::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
}

.factorin-frontend-container[data-theme="dark"]::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
}

/* بهبودهای دسترسی */
.factorin-col input:focus,
.factorin-col select:focus,
.factorin-col textarea:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.factorin-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* رسید فاکتور */
.invoice-receipt {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.receipt-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px dashed #667eea;
}

.receipt-icon {
    font-size: 4rem;
    margin-bottom: 10px;
}

.receipt-header h2 {
    color: #28a745;
    margin: 10px 0;
    font-size: 1.5rem;
}

.receipt-subtitle {
    color: #6c757d;
    font-size: 0.9rem;
}

.receipt-body {
    margin-top: 20px;
}

.receipt-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.receipt-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.receipt-row:last-child {
    border-bottom: none;
}

.receipt-row.total {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px;
    border-radius: 6px;
    margin-top: 10px;
    font-weight: 700;
    font-size: 1.1rem;
}

.receipt-label {
    font-weight: 500;
    color: #495057;
}

.receipt-row.total .receipt-label,
.receipt-row.total .receipt-value {
    color: white;
}

.receipt-value {
    font-weight: 600;
    color: #667eea;
}

.receipt-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* تم تاریک رسید */
.factorin-frontend-container[data-theme="dark"] .invoice-receipt {
    background: rgba(255, 255, 255, 0.05);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.factorin-frontend-container[data-theme="dark"] .receipt-header {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.factorin-frontend-container[data-theme="dark"] .receipt-header h2 {
    color: #28a745;
}

.factorin-frontend-container[data-theme="dark"] .receipt-subtitle {
    color: #b8b8b8;
}

.factorin-frontend-container[data-theme="dark"] .receipt-info {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.factorin-frontend-container[data-theme="dark"] .receipt-row {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.factorin-frontend-container[data-theme="dark"] .receipt-label {
    color: #e8e8e8;
}

.factorin-frontend-container[data-theme="dark"] .receipt-value {
    color: #ffffff;
}

/* حالت چاپ - فقط رسید */
@media print {
    body * {
        visibility: hidden;
    }
    
    .invoice-receipt,
    .invoice-receipt * {
        visibility: visible;
    }
    
    .invoice-receipt {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        box-shadow: none;
        background: white;
        page-break-inside: avoid;
    }
    
    .factorin-header,
    .receipt-actions,
    .factorin-actions {
        display: none !important;
    }
    
    .receipt-header {
        border-bottom: 2px solid #667eea;
    }
}

/* ========================================
   مدیریت فاکتورها در فرانت‌اند
   ======================================== */

.factorin-manager-container {
    max-width: 1400px;
    margin: 0 auto;
    font-family: 'Vazir', 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
    text-align: right;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 0;
}

/* هدر مدیریت */
.manager-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    padding: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.manager-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 2;
}

.manager-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 10px 0;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.manager-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0;
}

.header-actions {
    position: relative;
    z-index: 2;
}

.btn-create-invoice {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.btn-create-invoice:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* آمار کلی */
.stats-section {
    padding: 30px 40px;
    background: #f8f9fa;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

/* تب‌های مدیریت */
.manager-tabs {
    background: white;
}

.tabs-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 0 40px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 20px 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.tab-icon {
    font-size: 1.2rem;
}

/* محتوای تب‌ها */
.tab-content {
    display: none;
    padding: 30px 40px;
}

.tab-content.active {
    display: block;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
}

.search-filters {
    display: flex;
    gap: 15px;
    align-items: center;
    flex: 1;
}

.search-input {
    padding: 10px 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    min-width: 250px;
    transition: border-color 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-select,
.filter-date {
    padding: 10px 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
}

.content-actions {
    display: flex;
    gap: 10px;
}

.btn-refresh,
.btn-add-customer,
.btn-add-product {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-refresh:hover,
.btn-add-customer:hover,
.btn-add-product:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

/* لیست‌ها */
.invoices-list,
.customers-list,
.products-list {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.loading-state {
    padding: 60px 20px;
    text-align: center;
    color: #6c757d;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* مودال‌ها */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.modal-content.large {
    max-width: 900px;
}

.modal-header {
    padding: 25px 30px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #dc3545;
}

.modal-body {
    padding: 30px;
}

/* فرم‌ها */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.btn-primary {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .factorin-manager-container {
        margin: 10px;
        border-radius: 12px;
    }
    
    .manager-header {
        padding: 30px 20px;
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .manager-title {
        font-size: 2rem;
    }
    
    .stats-section {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tabs-nav {
        padding: 0 20px;
        overflow-x: auto;
    }
    
    .tab-btn {
        padding: 15px 20px;
        white-space: nowrap;
    }
    
    .tab-content {
        padding: 20px;
    }
    
    .content-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .search-filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-input {
        min-width: auto;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-header,
    .modal-body {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* تم تاریک */
.factorin-manager-container[data-theme="dark"] {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
}

.factorin-manager-container[data-theme="dark"] .stats-section {
    background: rgba(255, 255, 255, 0.05);
}

.factorin-manager-container[data-theme="dark"] .stat-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.factorin-manager-container[data-theme="dark"] .stat-label {
    color: #b8b8b8;
}

.factorin-manager-container[data-theme="dark"] .tabs-nav {
    background: rgba(255, 255, 255, 0.05);
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.factorin-manager-container[data-theme="dark"] .tab-btn {
    color: #b8b8b8;
}

.factorin-manager-container[data-theme="dark"] .tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.factorin-manager-container[data-theme="dark"] .tab-btn.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.factorin-manager-container[data-theme="dark"] .tab-content {
    background: rgba(255, 255, 255, 0.02);
}

.factorin-manager-container[data-theme="dark"] .search-input,
.factorin-manager-container[data-theme="dark"] .filter-select,
.factorin-manager-container[data-theme="dark"] .filter-date {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.factorin-manager-container[data-theme="dark"] .search-input::placeholder {
    color: #888;
}

.factorin-manager-container[data-theme="dark"] .invoices-list,
.factorin-manager-container[data-theme="dark"] .customers-list,
.factorin-manager-container[data-theme="dark"] .products-list {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.factorin-manager-container[data-theme="dark"] .modal-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.factorin-manager-container[data-theme="dark"] .modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.factorin-manager-container[data-theme="dark"] .modal-header h3 {
    color: #ffffff;
}

.factorin-manager-container[data-theme="dark"] .form-group label {
    color: #ffffff;
}

.factorin-manager-container[data-theme="dark"] .form-group input,
.factorin-manager-container[data-theme="dark"] .form-group textarea,
.factorin-manager-container[data-theme="dark"] .form-group select {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.factorin-manager-container[data-theme="dark"] .form-group input::placeholder,
.factorin-manager-container[data-theme="dark"] .form-group textarea::placeholder {
    color: #888;
}

.factorin-manager-container[data-theme="dark"] .form-actions {
    border-top-color: rgba(255, 255, 255, 0.2);
}

/* آیتم‌های لیست */
.invoice-item,
.customer-item,
.product-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.3s ease;
}

.invoice-item:hover,
.customer-item:hover,
.product-item:hover {
    background-color: #f8f9fa;
}

.invoice-item:last-child,
.customer-item:last-child,
.product-item:last-child {
    border-bottom: none;
}

.invoice-info,
.customer-info,
.product-info {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    align-items: center;
}

.invoice-number,
.customer-name,
.product-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.invoice-customer,
.customer-email,
.product-description {
    color: #6c757d;
    font-size: 0.9rem;
}

.invoice-date,
.customer-phone,
.product-price {
    color: #495057;
    font-size: 0.9rem;
}

.invoice-amount {
    font-weight: 600;
    color: #28a745;
    font-size: 1.1rem;
}

.product-stock {
    color: #6c757d;
    font-size: 0.8rem;
}

.invoice-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    min-width: 80px;
}

.status-paid {
    background-color: #d4edda;
    color: #155724;
}

.status-pending {
    background-color: #fff3cd;
    color: #856404;
}

.status-overdue {
    background-color: #f8d7da;
    color: #721c24;
}

.invoice-actions,
.customer-actions,
.product-actions {
    display: flex;
    gap: 8px;
    margin-right: 15px;
}

.btn-view,
.btn-edit,
.btn-delete {
    background: none;
    border: 1px solid #e9ecef;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.btn-view:hover {
    background-color: #e3f2fd;
    border-color: #2196f3;
    color: #1976d2;
}

.btn-edit:hover {
    background-color: #fff3e0;
    border-color: #ff9800;
    color: #f57c00;
}

.btn-delete:hover {
    background-color: #ffebee;
    border-color: #f44336;
    color: #d32f2f;
}

.btn-icon {
    font-size: 1rem;
}

/* حالت‌های خالی و خطا */
.empty-state,
.error-state {
    padding: 60px 20px;
    text-align: center;
    color: #6c757d;
}

.error-state {
    color: #dc3545;
}

/* جزئیات فاکتور */
.invoice-details {
    max-width: 100%;
}

.detail-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.detail-section h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.detail-section p {
    margin: 8px 0;
    color: #495057;
}

.detail-section .products-list {
    margin-top: 15px;
}

.detail-section .product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #e9ecef;
}

/* تم تاریک برای آیتم‌ها */
.factorin-manager-container[data-theme="dark"] .invoice-item:hover,
.factorin-manager-container[data-theme="dark"] .customer-item:hover,
.factorin-manager-container[data-theme="dark"] .product-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.factorin-manager-container[data-theme="dark"] .invoice-number,
.factorin-manager-container[data-theme="dark"] .customer-name,
.factorin-manager-container[data-theme="dark"] .product-name {
    color: #ffffff;
}

.factorin-manager-container[data-theme="dark"] .invoice-customer,
.factorin-manager-container[data-theme="dark"] .customer-email,
.factorin-manager-container[data-theme="dark"] .product-description {
    color: #b8b8b8;
}

.factorin-manager-container[data-theme="dark"] .invoice-date,
.factorin-manager-container[data-theme="dark"] .customer-phone,
.factorin-manager-container[data-theme="dark"] .product-price {
    color: #d0d0d0;
}

.factorin-manager-container[data-theme="dark"] .product-stock {
    color: #888;
}

.factorin-manager-container[data-theme="dark"] .btn-view,
.factorin-manager-container[data-theme="dark"] .btn-edit,
.factorin-manager-container[data-theme="dark"] .btn-delete {
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.factorin-manager-container[data-theme="dark"] .btn-view:hover {
    background-color: rgba(33, 150, 243, 0.2);
    border-color: #2196f3;
}

.factorin-manager-container[data-theme="dark"] .btn-edit:hover {
    background-color: rgba(255, 152, 0, 0.2);
    border-color: #ff9800;
}

.factorin-manager-container[data-theme="dark"] .btn-delete:hover {
    background-color: rgba(244, 67, 54, 0.2);
    border-color: #f44336;
}

.factorin-manager-container[data-theme="dark"] .detail-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.factorin-manager-container[data-theme="dark"] .detail-section h4 {
    color: #ffffff;
}

.factorin-manager-container[data-theme="dark"] .detail-section p {
    color: #d0d0d0;
}

.factorin-manager-container[data-theme="dark"] .detail-section .product-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* ========================================
   بخش دمو و تست در Product Preview
   ======================================== */

/* نمایش داشبورد اصلی */
.product-dashboard-preview {
    padding: 60px 0;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #ffffff;
}

.dashboard-preview-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.dashboard-preview-image {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.preview-image-wrapper {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.preview-image-wrapper:hover {
    transform: translateY(-5px);
}

.preview-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.preview-description h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #ffffff;
}

.preview-description p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 30px;
    color: #cccccc;
}

.dashboard-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dashboard-features li {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 16px;
    color: #ffffff;
}

.dashboard-features .feature-icon {
    margin-left: 15px;
    font-size: 20px;
    width: 30px;
    text-align: center;
}

.product-demo {
    padding: 80px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.demo-tabs {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.demo-tab-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    overflow-x: auto;
}

.demo-tab-btn {
    background: none;
    border: none;
    padding: 20px 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 500;
    color: #6c757d;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    min-width: 200px;
    justify-content: center;
}

.demo-tab-btn:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.demo-tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

.demo-tab-icon {
    font-size: 1.2rem;
}

.demo-tab-content {
    display: none;
    padding: 40px;
}

.demo-tab-content.active {
    display: block;
}

.demo-section h3 {
    margin: 0 0 30px 0;
    color: #2c3e50;
    font-size: 1.5rem;
    font-weight: 600;
}

.demo-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.demo-form .form-group {
    margin-bottom: 0;
}

.demo-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.demo-form input,
.demo-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.demo-form input:focus,
.demo-form textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.demo-products-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e9ecef;
}

.demo-products-section h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.demo-product-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 15px;
    align-items: end;
    padding: 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.btn-remove-product {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-product:hover {
    background: #c82333;
    transform: scale(1.05);
}

.btn-add-product {
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-add-product:hover {
    background: #218838;
    transform: translateY(-2px);
}

.demo-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.btn-demo-create,
.btn-demo-preview,
.btn-demo-add-customer,
.btn-demo-add-product,
.btn-demo-refresh {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.btn-demo-preview {
    background: #6c757d;
}

.btn-demo-add-customer,
.btn-demo-add-product {
    background: #28a745;
}

.btn-demo-refresh {
    background: #17a2b8;
}

.btn-demo-create:hover,
.btn-demo-preview:hover,
.btn-demo-add-customer:hover,
.btn-demo-add-product:hover,
.btn-demo-refresh:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.demo-customers,
.demo-products {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.demo-customer-form,
.demo-product-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
}

.demo-customer-form h4,
.demo-product-form h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.demo-customers-list,
.demo-products-list {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
}

.demo-customers-list h4,
.demo-products-list h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.demo-loading {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
}

.demo-dashboard {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
}

.demo-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.demo-stat-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.demo-stat-card:hover {
    transform: translateY(-5px);
}

.demo-stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
}

.demo-stat-content {
    flex: 1;
}

.demo-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.demo-stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.demo-recent-activity {
    margin-bottom: 30px;
}

.demo-recent-activity h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .product-demo {
        padding: 40px 0;
    }
    
    .demo-tab-content {
        padding: 20px;
    }
    
    .demo-tab-btn {
        padding: 15px 20px;
        min-width: 150px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .demo-product-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .demo-actions {
        flex-direction: column;
    }
    
    .demo-customers,
    .demo-products {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .demo-stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* تم تاریک */
.factorin-product-preview[data-theme="dark"] .product-demo {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.factorin-product-preview[data-theme="dark"] .demo-tabs {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.factorin-product-preview[data-theme="dark"] .demo-tab-nav {
    background: rgba(255, 255, 255, 0.05);
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.factorin-product-preview[data-theme="dark"] .demo-tab-btn {
    color: #b8b8b8;
}

.factorin-product-preview[data-theme="dark"] .demo-tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.factorin-product-preview[data-theme="dark"] .demo-tab-btn.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.factorin-product-preview[data-theme="dark"] .demo-section h3 {
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] .demo-form {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.factorin-product-preview[data-theme="dark"] .demo-form label {
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] .demo-form input,
.factorin-product-preview[data-theme="dark"] .demo-form textarea {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] .demo-form input::placeholder,
.factorin-product-preview[data-theme="dark"] .demo-form textarea::placeholder {
    color: #888;
}

.factorin-product-preview[data-theme="dark"] .demo-products-section {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.factorin-product-preview[data-theme="dark"] .demo-products-section h4 {
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] .demo-product-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.factorin-product-preview[data-theme="dark"] .demo-actions {
    border-top-color: rgba(255, 255, 255, 0.2);
}

.factorin-product-preview[data-theme="dark"] .demo-customer-form,
.factorin-product-preview[data-theme="dark"] .demo-product-form,
.factorin-product-preview[data-theme="dark"] .demo-customers-list,
.factorin-product-preview[data-theme="dark"] .demo-products-list,
.factorin-product-preview[data-theme="dark"] .demo-dashboard {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.factorin-product-preview[data-theme="dark"] .demo-customer-form h4,
.factorin-product-preview[data-theme="dark"] .demo-product-form h4,
.factorin-product-preview[data-theme="dark"] .demo-customers-list h4,
.factorin-product-preview[data-theme="dark"] .demo-products-list h4,
.factorin-product-preview[data-theme="dark"] .demo-recent-activity h4 {
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] .demo-stat-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.factorin-product-preview[data-theme="dark"] .demo-stat-label {
    color: #b8b8b8;
}

/* نتایج و پیش‌نمایش دمو */
.demo-invoice-result {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.demo-invoice-result h4 {
    color: #155724;
    margin: 0 0 15px 0;
}

.invoice-summary,
.products-summary,
.total-summary {
    margin-bottom: 15px;
}

.products-summary h5,
.total-summary h5 {
    margin: 0 0 10px 0;
    color: #155724;
}

.product-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #c3e6cb;
}

.product-summary-item:last-child {
    border-bottom: none;
}

.total-summary h5 {
    font-size: 1.2rem;
    color: #155724;
    text-align: center;
    padding: 10px;
    background: #c3e6cb;
    border-radius: 6px;
}

/* پیش‌نمایش فاکتور */
.invoice-preview {
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.preview-header {
    background: #667eea;
    color: white;
    padding: 20px;
    text-align: center;
}

.preview-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
}

.preview-header p {
    margin: 0;
    opacity: 0.9;
}

.preview-customer,
.preview-products {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.preview-customer h4,
.preview-products h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.preview-customer p {
    margin: 5px 0;
    color: #495057;
}

.preview-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.preview-table th,
.preview-table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid #e9ecef;
}

.preview-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.preview-table tfoot td {
    background: #f8f9fa;
    font-weight: 600;
    border-top: 2px solid #667eea;
}

/* فعالیت‌های اخیر */
.demo-activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
}

.activity-icon {
    font-size: 1.5rem;
    opacity: 0.8;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 5px;
}

.activity-time {
    font-size: 0.8rem;
    color: #6c757d;
}

/* تم تاریک برای نتایج */
.factorin-product-preview[data-theme="dark"] .demo-invoice-result {
    background: rgba(40, 167, 69, 0.2);
    border-color: rgba(40, 167, 69, 0.3);
}

.factorin-product-preview[data-theme="dark"] .demo-invoice-result h4 {
    color: #28a745;
}

.factorin-product-preview[data-theme="dark"] .products-summary h5,
.factorin-product-preview[data-theme="dark"] .total-summary h5 {
    color: #28a745;
}

.factorin-product-preview[data-theme="dark"] .product-summary-item {
    border-bottom-color: rgba(40, 167, 69, 0.3);
}

.factorin-product-preview[data-theme="dark"] .total-summary h5 {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.factorin-product-preview[data-theme="dark"] .preview-customer,
.factorin-product-preview[data-theme="dark"] .preview-products {
    background: rgba(255, 255, 255, 0.05);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.factorin-product-preview[data-theme="dark"] .preview-customer h4,
.factorin-product-preview[data-theme="dark"] .preview-products h4 {
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] .preview-customer p {
    color: #d0d0d0;
}

.factorin-product-preview[data-theme="dark"] .preview-table th {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] .preview-table td {
    color: #d0d0d0;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.factorin-product-preview[data-theme="dark"] .preview-table tfoot td {
    background: rgba(255, 255, 255, 0.1);
    border-top-color: #667eea;
}

.factorin-product-preview[data-theme="dark"] .demo-activity-item {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

.factorin-product-preview[data-theme="dark"] .activity-title {
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] .activity-time {
    color: #b8b8b8;
}

/* ========================================
   تقویم شمسی ایرانی
   ======================================== */

.factorin-persian-calendar {
    max-width: 1200px;
    margin: 0 auto;
    font-family: 'Vazir', 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
    text-align: right;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* هدر تقویم */
.calendar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    color: white;
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.calendar-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 2;
}

.calendar-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 20px 0;
    color: #ffffff;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.current-date-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.today-persian,
.today-gregorian {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 15px 25px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.date-icon {
    font-size: 1.2rem;
}

.date-text {
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
}

/* کنترل‌های تقویم */
.calendar-controls {
    background: #f8f9fa;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
}

.btn-prev-month,
.btn-next-month {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.btn-prev-month:hover,
.btn-next-month:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.current-month-year {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
}

/* جدول تقویم */
.calendar-container {
    padding: 20px;
    background: white;
}

.persian-calendar-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 auto;
    max-width: 800px;
}

.day-header {
    background: #667eea;
    color: white;
    padding: 15px 10px;
    font-weight: 600;
    text-align: center;
    border: 1px solid #5a6fd8;
}

.calendar-day {
    width: 60px;
    height: 60px;
    text-align: center;
    vertical-align: middle;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: white;
}

.calendar-day:hover {
    background: #f8f9fa;
    transform: scale(1.05);
}

.calendar-day.today {
    background: #667eea;
    color: white;
    font-weight: 700;
}

.calendar-day.selected {
    background: #28a745;
    color: white;
    font-weight: 700;
}

.calendar-day.other-month {
    color: #ccc;
    background: #f8f9fa;
}

.calendar-day.weekend {
    background: #fff3cd;
}

.calendar-day.weekend.today {
    background: #667eea;
    color: white;
}

.calendar-day.weekend.selected {
    background: #28a745;
    color: white;
}

/* انتخاب تاریخ */
.date-selection {
    background: #f8f9fa;
    padding: 30px;
    border-top: 1px solid #e9ecef;
}

.date-selection h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.3rem;
    text-align: center;
}

.date-picker {
    max-width: 600px;
    margin: 0 auto;
}

.date-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.9rem;
}

.input-group select {
    padding: 12px 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.9rem;
    background: white;
    transition: border-color 0.3s ease;
}

.input-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.selected-date-display {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.selected-persian-date,
.selected-gregorian-date {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f8f9fa;
}

.selected-gregorian-date {
    border-bottom: none;
}

.selected-persian-date .label,
.selected-gregorian-date .label {
    font-weight: 500;
    color: #6c757d;
}

.selected-persian-date .date-value,
.selected-gregorian-date .date-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.1rem;
}

/* رویدادها */
.calendar-events {
    background: white;
    padding: 30px;
    border-top: 1px solid #e9ecef;
}

.calendar-events h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 1.3rem;
    text-align: center;
}

.no-events {
    text-align: center;
    color: #6c757d;
    padding: 40px 20px;
    font-style: italic;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .factorin-persian-calendar {
        margin: 10px;
        border-radius: 12px;
    }
    
    .calendar-header {
        padding: 30px 20px;
    }
    
    .calendar-title {
        font-size: 2rem;
    }
    
    .current-date-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .calendar-controls {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .calendar-day {
        width: 45px;
        height: 45px;
        font-size: 0.9rem;
    }
    
    .date-inputs {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .selected-persian-date,
    .selected-gregorian-date {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
}

/* تم تاریک */
.factorin-persian-calendar[data-theme="dark"] {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
}

.factorin-persian-calendar[data-theme="dark"] .calendar-controls {
    background: rgba(255, 255, 255, 0.05);
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.factorin-persian-calendar[data-theme="dark"] .current-month-year {
    color: #ffffff;
}

.factorin-persian-calendar[data-theme="dark"] .calendar-container {
    background: rgba(255, 255, 255, 0.02);
}

.factorin-persian-calendar[data-theme="dark"] .calendar-day {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.factorin-persian-calendar[data-theme="dark"] .calendar-day:hover {
    background: rgba(255, 255, 255, 0.1);
}

.factorin-persian-calendar[data-theme="dark"] .calendar-day.other-month {
    color: #888;
    background: rgba(255, 255, 255, 0.02);
}

.factorin-persian-calendar[data-theme="dark"] .calendar-day.weekend {
    background: rgba(255, 193, 7, 0.2);
}

.factorin-persian-calendar[data-theme="dark"] .date-selection {
    background: rgba(255, 255, 255, 0.05);
    border-top-color: rgba(255, 255, 255, 0.2);
}

.factorin-persian-calendar[data-theme="dark"] .date-selection h3 {
    color: #ffffff;
}

.factorin-persian-calendar[data-theme="dark"] .input-group label {
    color: #ffffff;
}

.factorin-persian-calendar[data-theme="dark"] .input-group select {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.factorin-persian-calendar[data-theme="dark"] .selected-date-display {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.factorin-persian-calendar[data-theme="dark"] .selected-persian-date,
.factorin-persian-calendar[data-theme="dark"] .selected-gregorian-date {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.factorin-persian-calendar[data-theme="dark"] .selected-persian-date .label,
.factorin-persian-calendar[data-theme="dark"] .selected-gregorian-date .label {
    color: #b8b8b8;
}

.factorin-persian-calendar[data-theme="dark"] .selected-persian-date .date-value,
.factorin-persian-calendar[data-theme="dark"] .selected-gregorian-date .date-value {
    color: #ffffff;
}

.factorin-persian-calendar[data-theme="dark"] .calendar-events {
    background: rgba(255, 255, 255, 0.02);
    border-top-color: rgba(255, 255, 255, 0.2);
}

.factorin-persian-calendar[data-theme="dark"] .calendar-events h3 {
    color: #ffffff;
}

.factorin-persian-calendar[data-theme="dark"] .no-events {
    color: #888;
}

/* ادامه استایل‌های پیشنمایش محصول در انتهای فایل */

/* هیروسکشن */
.product-hero {
    padding: 80px 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 20px 0;
    line-height: 1.3;
}

.hero-text p {
    font-size: 1.1rem;
    color: #6c757d;
    line-height: 1.8;
    margin: 0 0 40px 0;
}

.hero-stats {
    display: flex;
    gap: 40px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-showcase {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.showcase-screen {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
    transition: transform 0.3s ease;
}

.showcase-screen:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.screen-header {
    background: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #e9ecef;
}

.screen-dots {
    display: flex;
    gap: 8px;
}

.screen-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #dee2e6;
}

.screen-dots span:first-child {
    background: #ff5f57;
}

.screen-dots span:nth-child(2) {
    background: #ffbd2e;
}

.screen-dots span:last-child {
    background: #28ca42;
}

.screen-title {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.screen-content {
    padding: 30px 20px;
}

.dashboard-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.preview-card {
    background: #f8f9fa;
    padding: 20px 15px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.card-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.card-title {
    font-size: 0.8rem;
    color: #495057;
    font-weight: 600;
}

/* ویژگی‌های کلیدی */
.product-features {
    padding: 80px 40px;
    background: #ffffff;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 15px 0;
}

.section-header p {
    font-size: 1.1rem;
    color: #6c757d;
    margin: 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.feature-card {
    background: #ffffff;
    padding: 40px 30px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.feature-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 15px 0;
}

.feature-card p {
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

/* درباره محصول */
.product-about {
    padding: 80px 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 25px 0;
}

.about-text p {
    font-size: 1.1rem;
    color: #6c757d;
    line-height: 1.8;
    margin: 0 0 40px 0;
}

.about-highlights {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.highlight-icon {
    font-size: 1.5rem;
}

.highlight-text {
    font-weight: 600;
    color: #2c3e50;
}

.about-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-placeholder {
    width: 100%;
    max-width: 300px;
    height: 200px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.3);
}

.placeholder-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.placeholder-text {
    font-size: 1.1rem;
    font-weight: 600;
}

/* سوالات متداول */
.product-faq {
    padding: 80px 40px;
    background: #ffffff;
}

.faq-list {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.faq-question {
    padding: 25px 30px;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.faq-question:hover {
    background: #e9ecef;
}

.question-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.question-icon {
    font-size: 1.5rem;
    color: #667eea;
    transition: transform 0.3s ease;
}

.faq-item.active .question-icon {
    transform: rotate(45deg);
}

.faq-answer {
    padding: 0 30px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item.active .faq-answer {
    padding: 25px 30px;
    max-height: 200px;
}

.faq-answer p {
    color: #6c757d;
    line-height: 1.6;
    margin: 0;
}

/* فوتر */
.product-preview-footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 60px 40px 30px;
    text-align: center;
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-text h3 {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #ffffff;
}

.footer-text p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0 0 40px 0;
    line-height: 1.6;
    color: #ffffff;
}

.footer-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.btn-buy-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 20px 40px;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-buy-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.btn-price {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.footer-guarantee {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #28a745;
    font-weight: 600;
}

.guarantee-icon {
    font-size: 1.2rem;
}

.footer-bottom {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    margin: 0;
    opacity: 0.7;
    font-size: 0.9rem;
}

/* تم تاریک */
.factorin-product-preview[data-theme="dark"] {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] .product-hero {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
}

.factorin-product-preview[data-theme="dark"] .hero-text h2 {
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] .hero-text p {
    color: #b8b8b8;
}

.factorin-product-preview[data-theme="dark"] .product-features {
    background: rgba(255, 255, 255, 0.02);
}

.factorin-product-preview[data-theme="dark"] .section-header h2 {
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] .section-header p {
    color: #b8b8b8;
}

.factorin-product-preview[data-theme="dark"] .feature-card {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] .feature-card h3 {
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] .feature-card p {
    color: #b8b8b8;
}

.factorin-product-preview[data-theme="dark"] .product-about {
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
}

.factorin-product-preview[data-theme="dark"] .about-text h2 {
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] .about-text p {
    color: #b8b8b8;
}

.factorin-product-preview[data-theme="dark"] .highlight-item {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.factorin-product-preview[data-theme="dark"] .highlight-text {
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] .product-faq {
    background: rgba(255, 255, 255, 0.02);
}

.factorin-product-preview[data-theme="dark"] .faq-item {
    border-color: rgba(255, 255, 255, 0.1);
}

.factorin-product-preview[data-theme="dark"] .faq-question {
    background: rgba(255, 255, 255, 0.05);
}

.factorin-product-preview[data-theme="dark"] .faq-question:hover {
    background: rgba(255, 255, 255, 0.1);
}

.factorin-product-preview[data-theme="dark"] .question-text {
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] .faq-answer p {
    color: #b8b8b8;
}

/* Dark theme برای بخش داشبورد */
.factorin-product-preview[data-theme="dark"] .product-dashboard-preview {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

.factorin-product-preview[data-theme="dark"] .preview-description h3 {
    color: #ffffff;
}

.factorin-product-preview[data-theme="dark"] .preview-description p {
    color: #cccccc;
}

.factorin-product-preview[data-theme="dark"] .dashboard-features li {
    color: #ffffff;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .factorin-product-preview {
        margin: 10px;
        border-radius: 12px;
    }
    
    /* Responsive برای بخش داشبورد */
    .dashboard-preview-image {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .preview-description h3 {
        font-size: 24px;
    }
    
    .preview-description p {
        font-size: 14px;
    }
    
    .dashboard-features li {
        font-size: 14px;
    }
    
    .product-preview-header {
        padding: 40px 20px;
    }
    
    .header-controls {
        top: 15px;
        left: 15px;
        right: 15px;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .theme-toggle-btn {
        justify-content: center;
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .product-title {
        font-size: 2.5rem;
    }
    
    .product-subtitle {
        font-size: 1.1rem;
    }
    
    .price-amount {
        font-size: 2rem;
    }
    
    .product-hero {
        padding: 60px 20px;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .hero-text h2 {
        font-size: 2rem;
    }
    
    .hero-stats {
        justify-content: center;
        gap: 30px;
    }
    
    .product-features {
        padding: 60px 20px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-about {
        padding: 60px 20px;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .about-text h2 {
        font-size: 2rem;
    }
    
    .product-faq {
        padding: 60px 20px;
    }
    
    .faq-question {
        padding: 20px;
    }
    
    .faq-answer {
        padding: 0 20px;
    }
    
    .faq-item.active .faq-answer {
        padding: 20px;
    }
    
    .product-preview-footer {
        padding: 40px 20px 20px;
    }
    
    .footer-text h3 {
        font-size: 1.8rem;
    }
    
    .btn-buy-primary {
        padding: 15px 30px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .product-title {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .about-highlights {
        gap: 15px;
    }
    
    .highlight-item {
        padding: 12px 15px;
    }
}

/* Input group styles */
.input-group { 
    display: flex; 
    gap: 10px; 
    align-items: center; 
}

.input-group input { 
    flex: 1; 
}

.input-group button { 
    white-space: nowrap; 
}

