@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
body { font-family: 'Inter', sans-serif; }
.bg-primary { background-color: #F97316; }
.text-primary { color: #F97316; }
.border-primary { border-color: #F97316; }
.ring-primary { --tw-ring-color: #F97316; }
.hover\:bg-primary-dark:hover { background-color: #EA580C; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #F97316; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #EA580C; }
.accordion-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }
.nav-link.active { background-color: #FEF2E8; color: #F97316; font-weight: 600; }
.nav-link.active i { color: #F97316; }

/* RESPONSIVE STYLES */
/* Mobile Sidebar Drawer */
.mobile-menu-btn {
  display: none;
}

.mobile-sidebar-overlay {
  display: none;
}

@media (max-width: 768px) {
  /* Sidebar mobilde gizle, drawer olarak göster - Transform kullanımı daha performanslıdır */
  .app-screen aside {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    width: 80%; /* Mobilde sidebar biraz daha dar olabilir */
    max-width: 300px;
  }
  
  .app-screen aside.mobile-open {
    transform: translateX(0);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  }
  
  .mobile-sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px); /* Modern bir dokunuş */
  }
  
  .mobile-sidebar-overlay.active {
    opacity: 1;
    pointer-events: all;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  /* Main content mobilde tam genişlik */
  .app-screen main {
    width: 100%;
  }
  
  /* Header mobilde dikey düzen */
  header {
    flex-direction: column;
    height: auto;
    padding: 1rem;
    gap: 1rem;
  }
  
  header > div {
    width: 100%;
    justify-content: space-between;
  }
  
  /* Arama kutusu mobilde tam genişlik */
  #admin-search,
  input[type="text"][placeholder*="ara"],
  input[type="text"][placeholder*="Ara"] {
    width: 100% !important;
    max-width: 100%;
  }
  
  /* Bildirim mobilde üstte */
  #notification {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: calc(100% - 2rem);
  }
  
  /* Modaller mobilde tam ekran */
  .fixed.inset-0 > div {
    max-width: 100% !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
  
  /* Tablolar mobilde scroll */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  /* İş emri kartları mobilde kompakt */
  [data-workorder-id] {
    padding: 1rem !important;
  }
  
  [data-workorder-id] h4 {
    font-size: 1.125rem !important;
  }
  
  /* Butonlar mobilde tam genişlik veya dikey */
  .flex.space-x-3 {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .flex.space-x-3 > button,
  .flex.space-x-3 > select {
    flex: 1 1 auto;
    min-width: calc(50% - 0.25rem);
  }
  
  /* Filtre çubukları mobilde dikey */
  .grid.grid-cols-1.md\:grid-cols-5,
  .grid.grid-cols-1.md\:grid-cols-6,
  .grid.grid-cols-1.md\:grid-cols-7 {
    grid-template-columns: 1fr;
  }
  
  /* Sayfalama mobilde dikey */
  .flex.items-center.justify-between {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  /* Kullanıcı bilgisi mobilde gizle veya küçült */
  header .flex.items-center.space-x-2:last-child {
    display: none;
  }
  
  /* İstatistik kartları mobilde 2 sütun */
  .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  /* Work order card butonları mobilde dikey */
  .work-order-line-item .flex.items-start.justify-between {
    flex-direction: column;
    gap: 1rem;
  }
  
  .work-order-line-item .space-x-3 {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  /* Çok küçük ekranlar için ek optimizasyonlar */
  .grid.grid-cols-1.md\:grid-cols-2.lg\:grid-cols-4 {
    grid-template-columns: 1fr;
  }
  
  /* Buton metinlerini kısalt veya sadece ikon göster */
  button:not(.mobile-menu-btn) {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
  }
  
  button i {
    margin-right: 0.25rem !important;
  }
  
  /* Modal içerik padding azalt */
  .p-6 {
    padding: 1rem;
  }
  
  /* Form grid'leri tek sütun */
  .grid.grid-cols-1.md\:grid-cols-2 {
    grid-template-columns: 1fr;
  }
  
  .col-span-2 {
    grid-column: span 1;
  }
}