/* RF */
/* === GENERAL LAYOUT === */
body {
    font-family: 'Vazir', Arial, sans-serif;
    direction: rtl;
    text-align: right;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

label {
    display: block;
    text-align: right;
    font-weight: bold;
}

/* === FORM ELEMENTS === */
input,
select,
textarea {
    text-align: right;
    direction: rtl;
    font-family: 'Vazir', Arial, sans-serif;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    border: 1px solid var(--bs-border-color);
}

/* === BUTTONS === */
.btn {
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: scale(1.05);
}

.btn-success {
    background-color: var(--bs-success);
    border-color: var(--bs-success);
    color: #fff;
}

.btn-dark {
    background-color: var(--bs-dark);
    border-color: var(--bs-dark);
    color: #fff;
}

.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.btn-info {
    background-color: var(--bs-info);
    border-color: var(--bs-info);
    color: #fff;
}

/* === TABLES & CARDS === */
.card {
    border-radius: 12px;
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.card-header {
    font-size: 1.1rem;
    padding: 0.5rem 1rem;
}

.card-body {
    padding: 1rem;
}

.card-body p {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.table th,
.table td {
    background-color: transparent;
    color: var(--bs-body-color);
    vertical-align: middle;
    padding: 0.75rem 1rem;
}

.table-hover tbody tr:hover {
    background-color: var(--bs-tertiary-bg);
}

.table tbody tr {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.table tbody tr:last-child {
    border-bottom: none;
}

[data-bs-theme="dark"] .table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* === ORDER FORM SELECT BOXES === */
#category-selects select {
    min-width: 200px;
    flex: 1;
}

/* === TEXT DIRECTION FIXES === */
.order-number,
.fix-number {
    direction: ltr;
    text-align: left;
    unicode-bidi: bidi-override;
    display: inline-block;
}

/* === UTILITIES === */
.no-underline {
    text-decoration: none !important;
}

/* === RECEIPT TITLE === */
.receipt-title {
    display: none;
}

/* === CUSTOM FIELDS (Two Columns in Print) === */
.custom-fields-container {
    display: block; /* Default display for non-print */
}

.custom-field-item {
    margin-bottom: 0.3rem;
}

/* === PRINT STYLES === */
@media print {
    @page {
        size: A4 portrait;
        margin: 0.1cm; /* حداقل حاشیه ممکن */
    }

    /* تنظیمات عمومی صفحه */
    body,
    p,
    h1,
    h2,
    h3 {
        font-family: Tahoma, sans-serif !important;
        color: #000 !important;
        background-color: #fff !important;
        line-height: 1.2 !important; /* کاهش فاصله بین خطوط */
    }

    /* تنظیمات wrapper اصلی */
    .receipt-wrapper {
        border: 1px dashed #000 !important;
        padding: 5px !important; /* کاهش فاصله داخلی */
        margin: 0 auto !important;
        border-radius: 5px;
        width: 100% !important;
        background-color: #fff !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        transform: scale(0.85); /* کاهش اندازه چاپ برای جا شدن در یک صفحه */
        transform-origin: top center;
    }

    /* حذف المان‌های غیر ضروری در چاپ */
    .no-print {
        display: none !important;
    }

    /* تنظیمات Container اصلی */
    .container {
        width: 100% !important;
        max-width: 700px !important;
        margin: 0 auto !important;
        padding: 0 !important;
        box-sizing: border-box;
    }

    /* تنظیمات کارت‌ها */
    .card {
        border: 1px solid #ccc !important;
        background-color: #fff !important;
        color: #000 !important;
        margin-bottom: 5px !important; /* کاهش فاصله بین کارت‌ها */
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    /* کاهش فاصله داخلی کارت‌ها */
    .card-body {
        padding: 0.5rem !important;
    }

    .card-body p {
        font-size: 0.9rem !important;
        margin-bottom: 0.2rem !important;
    }

    .card-header {
        font-size: 1rem !important;
        padding: 0.2rem 0.4rem !important;
    }

    /* مخفی کردن المان‌های غیر ضروری در چاپ اصلی */
    body.customer-print .hide-in-customer-print {
        display: none !important;
    }

    /* عنوان رسید */
    .receipt-title {
        display: block !important;
        text-align: center;
        font-size: 1.3rem !important;
        margin-bottom: 5px !important;
    }

    /* دو ستونه کردن ویژگی‌های محصول */
    .custom-fields-container {
        display: flex;
        flex-wrap: wrap;
        gap: 0.2rem;
    }

    .custom-field-item {
        flex: 0 0 calc(50% - 0.2rem);
        margin-bottom: 0.2rem;
    }

    .custom-field-item p {
        margin: 0 !important;
        font-size: 0.8rem !important;
    }

    /* تنظیمات جدول‌ها */
    .table th,
    .table td {
        padding: 0.3rem !important;
        font-size: 0.85rem !important;
    }
}


.row-canceled {
    background-color: #ffcacb !important;  /* رنگ قرمز کم‌رنگ */
}

.row-delivered {
    background-color: #d8ffe0 !important; /* سبز بسیار کمرنگ */
}

[data-bs-theme="dark"] .row-canceled {
  background-color: rgba(255, 0, 0, 0.1) !important;
}
[data-bs-theme="dark"] .row-delivered {
  background-color: rgba(0, 255, 0, 0.1) !important;
}

/* 📅 تقویم جلالی – حالت تاریک سازگار با Bootstrap 5.3 */

[data-bs-theme="dark"] .jdp-container {
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease-in-out;
}

/* ✨ fade-in effect هنگام باز شدن */
.jdp-container {
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease-in-out;
}
.jdp-container[style*="display: block"] {
  opacity: 1;
  transform: translateY(0);
}

/* 🗓 روزها و نام روزها */
[data-bs-theme="dark"] .jdp-day,
[data-bs-theme="dark"] .jdp-day-name {
  background-color: #2a2a2a !important;
  color: #e0e0e0 !important;
  border-radius: 0.3rem;
  transition: all 0.2s ease-in-out;
}

[data-bs-theme="dark"] .jdp-day:hover:not(.disabled-day),
[data-bs-theme="dark"] .jdp-day-name:hover {
  background-color: #3c3c3c !important;
  transform: scale(1.05);
}

/* ✅ روز انتخاب‌شده */
[data-bs-theme="dark"] .jdp-day.selected,
[data-bs-theme="dark"] .jdp-day-name.selected {
  background-color: var(--bs-primary) !important;
  color: #fff !important;
  font-weight: bold;
}

/* 🔘 روزهای خارج از ماه */
[data-bs-theme="dark"] .jdp-day.not-in-month {
  color: #666 !important;
  background-color: transparent !important;
}

/* 🚫 روزهای غیرفعال */
[data-bs-theme="dark"] .jdp-day.disabled-day {
  color: #555 !important;
  opacity: 0.5;
  cursor: not-allowed;
}

/* 🗓 انتخاب ماه/سال/زمان */
[data-bs-theme="dark"] .jdp-container select,
[data-bs-theme="dark"] .jdp-container input[type="text"] {
  background-color: #333 !important;
  color: #f0f0f0 !important;
  border: 1px solid #444 !important;
  border-radius: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.85rem;
  color-scheme: dark;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

/* ➕ آیکن‌های بالا */
[data-bs-theme="dark"] .jdp-icon-plus,
[data-bs-theme="dark"] .jdp-icon-minus {
  background-color: #444 !important;
  color: #ccc !important;
  padding: 0.3rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease;
}
[data-bs-theme="dark"] .jdp-icon-plus:hover,
[data-bs-theme="dark"] .jdp-icon-minus:hover {
  background-color: #555 !important;
}

/* 🧩 فوتر و دکمه‌ها */
[data-bs-theme="dark"] .jdp-footer {
  background-color: #1f1f1f !important;
  border-top: 1px solid #444;
  padding-top: 0.75rem;
}

[data-bs-theme="dark"] .jdp-btn-today,
[data-bs-theme="dark"] .jdp-btn-empty,
[data-bs-theme="dark"] .jdp-btn-close {
  background-color: var(--bs-primary) !important;
  color: #fff !important;
  border: none;
  padding: 0.4rem 1rem;
  margin: 0 0.25rem;
  border-radius: 0.375rem;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

[data-bs-theme="dark"] .jdp-btn-today:hover,
[data-bs-theme="dark"] .jdp-btn-empty:hover,
[data-bs-theme="dark"] .jdp-btn-close:hover {
  background-color: var(--bs-primary-border-subtle) !important;
}

[data-bs-theme="dark"] .jdp-btn-today.disabled-btn,
[data-bs-theme="dark"] .jdp-btn-empty.disabled-btn {
  background-color: #555 !important;
  color: #aaa !important;
  opacity: 0.6;
  cursor: not-allowed;
}
