/* ============================================================================
   EK STILLER  -  Tailwind'in karsilamadigi kucuk dokunuslar
   ========================================================================== */

/* iPhone alt cubugu (home indicator) icin guvenli alan payi.
   Mobil alt navigasyonun butonlarinin cubuk altinda kalmasini onler. */
.pb-safe {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Mobilde "native app" hissi: metin seciminin kazara tetiklenmesini azalt */
body {
  -webkit-tap-highlight-color: transparent;
}

/* Ince, modern kaydirma cubugu */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }

/* Tablo satirlari uzerine gelince yumusak vurgulama */
.table-hover tbody tr { transition: background-color .12s ease; }
.table-hover tbody tr:hover { background-color: #f8fafc; }

/* Form elemanlari icin tutarli temel gorunum.
   Tailwind form plugin'i yuklemedigimiz icin burada tanimliyoruz. */
.inp {
  width: 100%;
  border-radius: .75rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: .625rem .875rem;
  font-size: .875rem;
  color: #1e293b;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.inp:focus {
  outline: none;
  background: #fff;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px #e0e7ff;
}
.inp:disabled { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; }
.inp.is-invalid { border-color: #fb7185; box-shadow: 0 0 0 3px #ffe4e6; }

.lbl {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: .375rem;
}

/* Birincil buton */
.btn-primary {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  background-image: linear-gradient(to right, #4f46e5, #7c3aed);
  color: #fff; font-weight: 700; font-size: .875rem;
  padding: .625rem 1.125rem; border-radius: .75rem;
  box-shadow: 0 8px 20px -8px rgba(79, 70, 229, .6);
  transition: transform .12s, box-shadow .12s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(79, 70, 229, .7); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Ikincil buton */
.btn-ghost {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  background: #fff; color: #475569; font-weight: 600; font-size: .875rem;
  padding: .625rem 1.125rem; border-radius: .75rem; border: 1px solid #e2e8f0;
  transition: background-color .12s;
}
.btn-ghost:hover { background: #f8fafc; }

/* Tehlikeli islem butonu */
.btn-danger {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  background: #e11d48; color: #fff; font-weight: 700; font-size: .875rem;
  padding: .625rem 1.125rem; border-radius: .75rem;
}
.btn-danger:hover { background: #be123c; }

/* Kart */
.card {
  background: #fff;
  border: 1px solid #e9eef5;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 28px -16px rgba(16, 24, 40, .16);
}

/* Yukleniyor animasyonu (iskelet) */
@keyframes shimmer { 100% { transform: translateX(100%); } }
.skeleton { position: relative; overflow: hidden; background: #eef2f7; border-radius: .5rem; }
.skeleton::after {
  content: ''; position: absolute; inset: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,.65) 50%, rgba(255,255,255,0) 100%);
  animation: shimmer 1.4s infinite;
}

/* Drag & drop alani aktif durumu */
.dropzone.is-over { border-color: #6366f1; background: #eef2ff; }

/* Yazdirma: sadece icerik basilsin, menu/butonlar gizlensin */
@media print {
  #sidebar, header, nav, footer, .no-print, .form-actionbar, .modal { display: none !important; }
  .lg\:pl-72 { padding-left: 0 !important; }
  main { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ============================================================================
   YAN PANEL (DRAWER) FORMLAR
   ----------------------------------------------------------------------------
   Tum ekle/duzenle pencereleri sagdan acilan genis bir paneldir:
     .drawer-head : baslik (sabit)
     .drawer-body : form alanlari (kendi icinde kayar)
     .drawer-foot : Kaydet / Vazgec (DAIMA gorunur; asagi kaydirmaya gerek yok)
   Mobilde panel tam ekran olur.
   ========================================================================== */
.modal { position: fixed; inset: 0; z-index: 60; }
.modal > .drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(100%, 760px);
  background: #fff;
  display: flex; flex-direction: column;
  box-shadow: -24px 0 60px -20px rgba(15, 23, 42, .45);
  animation: drawerIn .22s ease-out;
}
.modal > .drawer.drawer-sm { width: min(100%, 520px); }
.modal > .drawer.drawer-lg { width: min(100%, 1040px); }
.drawer-head {
  flex: none; display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1.5rem; border-bottom: 1px solid #eef2f7;
  background: linear-gradient(to right, #fff, #f8fafc);
}
.drawer-head h3 { font-weight: 800; color: #0f172a; font-size: 1.05rem; }
.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 1.5rem; overscroll-behavior: contain; }
.drawer-foot {
  flex: none; display: flex; align-items: center; gap: .5rem; justify-content: flex-end;
  padding: .875rem 1.5rem; border-top: 1px solid #eef2f7; background: #f8fafc;
  padding-bottom: calc(.875rem + env(safe-area-inset-bottom, 0px));
}
.drawer-close {
  margin-left: auto; width: 2.25rem; height: 2.25rem; border-radius: .75rem;
  display: grid; place-items: center; color: #64748b;
}
.drawer-close:hover { background: #f1f5f9; color: #0f172a; }
@keyframes drawerIn { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (max-width: 640px) {
  .drawer-body { padding: 1rem; }
  .drawer-head, .drawer-foot { padding-left: 1rem; padding-right: 1rem; }
}

/* Sayfa formlari (arac / ekspertiz): kaydet cubugu ekranin altinda sabit */
.form-actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-top: 1px solid #e2e8f0; padding: .75rem 1rem;
  display: flex; align-items: center; gap: .5rem;
}
@media (min-width: 1024px) { .form-actionbar { left: 18rem; padding: .75rem 1.75rem; } }
@media (max-width: 1023px) { .form-actionbar { bottom: 64px; } }
.form-actionbar-space { height: 5rem; }
@media (max-width: 1023px) { .form-actionbar-space { height: 9rem; } }

/* Liste / kart gorunumu degistirici */
.seg { display: inline-flex; padding: .25rem; gap: .125rem; border-radius: .75rem; background: #e2e8f0; }
.seg > button { display: inline-flex; align-items: center; gap: .375rem; padding: .375rem .75rem; border-radius: .5rem;
                font-size: .8rem; font-weight: 700; color: #64748b; }
.seg > button.on { background: #fff; color: #4338ca; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* Dokunmatik cihazlarda daha buyuk hedefler */
@media (pointer: coarse) {
  .inp { min-height: 44px; font-size: 16px; }   /* iOS'ta odaklanirken yakinlastirmayi onler */
  .btn-primary, .btn-ghost, .btn-danger { min-height: 44px; }
}
