@font-face {
  font-family: 'Vazir';
  src: local('Vazir'), local('Vazirmatn');
}
body {
  font-family: Vazir, system-ui, sans-serif;
}

@media print {
  body * {
    visibility: hidden;
  }
  #printArea,
  #printArea * {
    visibility: visible;
  }
  #printArea {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  .no-print {
    display: none !important;
  }
}

@media (max-width: 640px) {
  .tab-btn {
    flex: 1;
    justify-content: center;
    min-width: 60px;
    white-space: nowrap;
  }
  .tab-btn svg {
    margin: 0 auto;
  }
}

/* اثر active برای تب‌ها */
.tab-btn.active {
  border-bottom-width: 2px;
  border-color: #3b82f6;
  color: #3b82f6;
  background-color: #eff6ff;
}

.tab-btn:not(.active) {
  border-bottom-width: 2px;
  border-color: transparent;
}

/* انیمیشن برای هاور */
.tab-btn {
  transition: all 0.2s ease;
}

.tab-btn:hover {
  transform: translateY(-1px);
}

.role-card {
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.role-card.active {
  background-color: #eff6ff;
  border-color: #3b82f6;
}
.permission-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  transition: background 0.2s;
  border-bottom: 1px solid #f1f5f9;
}
.permission-item:hover {
  background-color: #f8fafc;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-in {
  animation: fadeIn 0.3s ease-out;
}
.toast {
  animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* بهبود اسکرول در موبایل */
@media (max-width: 768px) {
  #workshopModal .overflow-y-auto {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
  }

  #workshopModal .overflow-y-auto::-webkit-scrollbar {
    width: 4px;
  }

  #workshopModal .overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
  }

  #workshopModal .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
  }

  /* بهبود تاچ برای موبایل */
  #workshopModal input,
  #workshopModal select,
  #workshopModal textarea,
  #workshopModal button {
    font-size: 16px; /* جلوگیری از زوم خودکار در iOS */
  }
}

/* بهبود اسکرول در موبایل */
@media (max-width: 768px) {
  #editWorkshopModal .overflow-y-auto {
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
  }

  #editWorkshopModal .overflow-y-auto::-webkit-scrollbar {
    width: 4px;
  }

  #editWorkshopModal .overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
  }

  #editWorkshopModal .overflow-y-auto::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
  }

  /* بهبود تاچ برای موبایل */
  #editWorkshopModal input,
  #editWorkshopModal select,
  #editWorkshopModal textarea,
  #editWorkshopModal button {
    font-size: 16px; /* جلوگیری از زوم خودکار در iOS */
  }

  /* افزایش ناحیه قابل لمس برای چک‌باکس‌ها */
  #editWorkshopModal .employee-checkbox {
    width: 18px;
    height: 18px;
  }
}

/* Toast Animation */
@keyframes slideInFromBottom {
  from {
    transform: translateY(1rem);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.animate-in {
  animation: slideInFromBottom 0.3s ease-out;
}

/* Table row transition */
.feature-row {
  transition: background-color 0.2s ease;
}

.feature-row.hidden {
  display: none;
}

/* Modal smooth transition */
#featureModal,
#deletePopup {
  transition: opacity 0.2s ease;
}

/* Toast Animation */
@keyframes slideInFromBottom {
  from {
    transform: translateY(1rem);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.animate-in {
  animation: slideInFromBottom 0.3s ease-out;
}

/* Table row transition */
.material-row {
  transition: background-color 0.2s ease;
}

.material-row.hidden {
  display: none;
}

/* Modal smooth transition */
#materialModal,
#deletePopup {
  transition: opacity 0.2s ease;
}

/* Toast Animation */
@keyframes slideInFromBottom {
  from {
    transform: translateY(1rem);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.animate-in {
  animation: slideInFromBottom 0.3s ease-out;
}

/* Table row transition */
.machine-row {
  transition: background-color 0.2s ease;
}

.machine-row.hidden {
  display: none;
}

/* Modal smooth transition */
#machineModal,
#deletePopup {
  transition: opacity 0.2s ease;
}

.tab-content {
  transition: all 0.3s ease;
}
.file-item {
  transition: all 0.2s ease;
}
.file-item:hover {
  transform: translateX(-4px);
}
.modal {
  backdrop-filter: blur(4px);
}
.step-completed {
  background-color: #10b981;
}
.summary-card {
  transition: all 0.3s ease;
}
.order-item-card {
  transition: all 0.2s ease;
  cursor: move;
}
.order-item-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateX(-4px);
}
.difficulty-dot {
  transition: all 0.2s ease;
  cursor: pointer;
}
.difficulty-dot:hover {
  transform: scale(1.2);
}
.progress-bar {
  transition: width 0.3s ease;
}

.tab-btn.active {
  background-color: #3b82f6 !important;
  color: white !important;
  border-bottom: 2px solid #3b82f6 !important;
}
.tab-btn.active svg {
  stroke: white !important;
}

@media (max-width: 768px) {
  .material-row,
  .property-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid #e2e8f0;
  }
  .material-row > div,
  .property-row > div {
    width: 100%;
  }
  .material-row label,
  .property-row label {
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: block;
  }
}

.sales-type-btn.active {
  background-color: #3b82f6 !important;
  color: white !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.file-progress-container {
  background-color: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  height: 6px;
}
.file-progress-bar {
  transition: width 0.3s ease;
  background-color: #10b981;
  height: 100%;
}

.move-btn {
  transition: all 0.2s ease;
}
.move-btn:hover {
  transform: scale(1.1);
  background-color: #e2e8f0;
}

/* استایل لیست فایل‌های هر آیتم */
.item-files-list {
  max-height: 150px;
  overflow-y: auto;
}

/* هماهنگ‌سازی استایل datepicker با Tailwind */
.persian-datepicker .picker {
  border-radius: 12px !important;
  box-shadow:
    0 10px 25px -5px rgba(0, 0, 0, 0.1),
    0 8px 10px -6px rgba(0, 0, 0, 0.02) !important;
  border: 1px solid #e2e8f0 !important;
}

.persian-datepicker .picker-header {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.persian-datepicker table td {
  padding: 8px !important;
}

.persian-datepicker table td a {
  border-radius: 8px !important;
  transition: all 0.2s !important;
}

.persian-datepicker table td a:hover {
  background-color: #3b82f6 !important;
  color: white !important;
}

.persian-datepicker .selected a {
  background-color: #3b82f6 !important;
  color: white !important;
  border-radius: 8px !important;
}

/* Hide number input spinners but keep functionality */
input[type='number'] {
  -moz-appearance: textfield;
}
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  opacity: 1;
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: white;
  padding: 12px 24px;
  border-radius: 12px;
  display: none;
  z-index: 1100;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
}

.toast.show {
  display: block;
  animation: slideUp 0.3s ease;
}

.toast.success {
  background: #10b981;
}
.toast.error {
  background: #ef4444;
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

@keyframes slideDown {
  from {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
  to {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
  }
}

/* sidebar*/
/* اطمینان از اینکه سایدبار در موبایل کاملاً مخفی است */
@media (max-width: 767px) {
  #sidebar {
    transform: translateX(100%);
    transition: transform 0.3s ease;
    width: 85% !important;
    max-width: 320px !important;
  }

  #sidebar.translate-x-full {
    transform: translateX(100%);
  }

  #sidebar:not(.translate-x-full) {
    transform: translateX(0);
  }

  #overlay {
    transition: all 0.3s ease;
  }

  /* main تگ در موبایل نباید فاصله از راست داشته باشد */
  main {
    margin-right: 0 !important;
  }
}

@media (min-width: 768px) {
  #sidebar {
    transform: translateX(0) !important;
  }

  main {
    margin-right: 20rem; /* 80 = w-80 */
  }
}

#sidebar .overflow-y-auto {
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#sidebar .overflow-y-auto::-webkit-scrollbar {
  display: none;
}

/* add olgho*/
.template-page {
  min-height: 100vh;
}

/* استایل سرچ باکس عمومی */
.search-select {
  position: relative;
  width: 100%;
}

.search-select-input {
  width: 100%;
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  background-color: white;
  cursor: pointer;
}

.search-select-input:focus {
  outline: none;
  ring: 2px solid #3b82f6;
  border-color: #3b82f6;
}

.search-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  max-height: 250px;
  overflow-y: auto;
  display: none;
}

.search-select-dropdown.show {
  display: block;
}

.search-select-item {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.search-select-item:hover {
  background-color: #f1f5f9;
}

/* حذف overflow از کانتینرها */
#materialsContainer,
#propertiesContainer {
  overflow: visible !important;
}

/* اطمینان از visible بودن overflow در تمام والدین */
.bg-slate-50,
.rounded-xl,
.p-5,
.two-column-layout > div {
  overflow: visible !important;
}

.material-row,
.property-row {
  position: relative;
  margin-bottom: 0.75rem;
  overflow: visible !important;
}

/* چیدمان دو ستونی */
@media (min-width: 1024px) {
  .two-column-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 1.5rem !important;
  }
}

@media (max-width: 1023px) {
  .two-column-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.5rem !important;
  }
}

/* موبایل */
@media (max-width: 768px) {
  .material-row .flex,
  .property-row .flex {
    flex-direction: column !important;
  }
  .material-row button,
  .property-row button {
    width: 100% !important;
  }
}


/*start add_olgho_sefaresh */ 
    .order-page {
      min-height: 100vh;
    }
    
    /* استایل سرچ باکس */
    .search-select {
      position: relative;
      width: 100%;
    }
    
    .search-select-input {
      width: 100%;
      padding: 0.5rem 2rem 0.5rem 0.75rem;
      border: 1px solid #cbd5e1;
      border-radius: 0.5rem;
      font-size: 0.875rem;
      background-color: white;
      cursor: pointer;
    }
    
    .search-select-input:focus {
      outline: none;
      ring: 2px solid #3b82f6;
      border-color: #3b82f6;
    }
    
    .search-select-dropdown {
      position: absolute;
      top: calc(100% + 4px);
      right: 0;
      left: 0;
      background: white;
      border: 1px solid #e2e8f0;
      border-radius: 0.75rem;
      box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
      z-index: 9999;
      max-height: 250px;
      overflow-y: auto;
      display: none;
    }
    
    .search-select-dropdown.show {
      display: block;
    }
    
    .search-select-item {
      padding: 0.5rem 0.75rem;
      cursor: pointer;
      transition: all 0.2s;
      font-size: 0.875rem;
    }
    
    .search-select-item:hover {
      background-color: #f1f5f9;
    }
    
    /* استایل درگ اندراپ */
    .template-row {
      transition: all 0.2s;
      cursor: move;
    }
    
    .template-row.dragging {
      opacity: 0.5;
      cursor: grabbing;
    }
    
    .template-row.drag-over {
      border-top: 2px solid #3b82f6;
      margin-top: -2px;
    }
    
    /* حذف overflow مشکل‌ساز */
    #templatesContainer {
      overflow: visible !important;
    }
    
    .template-row {
      overflow: visible !important;
    }
    
    /* موبایل */
    @media (max-width: 768px) {
      .template-row .grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
      }
      .action-buttons {
        justify-content: center !important;
      }
    }


/*end add_olgho_sefaresh */ 