/* Add here all your CSS customizations */

/* Personel Detay (ZeynERP ile birebir görünüm): kart başlığı + sağa yaslı etiketler.
   z-bolum/z-bolum-baslik ve sade .control-label ZeynERP temasında vardı, burada yok;
   küçük eklerle aynı görünüm sağlanır. action-buttons-fixed/nav-pills temada mevcut. */
.card.card-modern .card-header.z-bolum {
    padding: .85rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}
.z-bolum-baslik {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}
.control-label {
    font-weight: 600;
    color: #495057;
}
/* Sol dikey sekme menüsü: aktif sekme belirgin, ikonlar hizalı. */
#personelTab .nav-link {
    color: #51545c;
    border-radius: 6px;
    padding: .55rem .85rem;
    text-align: left;
    white-space: normal;
}
#personelTab .nav-link.active {
    background-color: #0088cc;
    color: #fff;
}
#personelTab .nav-link i {
    width: 1.1rem;
    text-align: center;
}

/* Durum etiketleri: dolu, kenarsız (tam dikdörtgen) renk blokları (Bootstrap badge yerine).
   Tablolardaki durum sütunlarında kullanılır; metin aynı kaldığı için DataTables durum
   filtreleri etkilenmez. */
/* Durum hücresini etiket taban-tavan TAM kaplasın:
   - hücre iç boşluğu 0 + height:1px "trick"i (çocuğun height:100%'u hücrenin GERÇEK
     render yüksekliğine çözülsün; satır başka hücre yüzünden yüksek olsa bile blok dolsun).
   - satır da (tr) 100% ki td gerçek yüksekliği alsın. */
table tr:has(> td > .durum-etiket) { height: 100%; }
td:has(> .durum-etiket) {
    padding: 0 !important;
    height: 1px;            /* Chrome/Edge: child height:100% buna göre gerçek yüksekliğe çözülür */
    vertical-align: middle;
}
.durum-etiket {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 44px;
    padding: 6px 12px;
    border-radius: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .2px;
    color: #fff;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
}

/* Renkler — hem anlamsal (sipariş) hem renk-adlı (diğer modüller) sınıflar. */
.durum-beklemede,  .durum-amber   { background: #f59e0b; }  /* amber   */
.durum-yolda,      .durum-mavi    { background: #2563eb; }  /* mavi    */
.durum-tamamlandi, .durum-yesil   { background: #16a34a; }  /* yeşil   */
.durum-iptal,      .durum-gri     { background: #6b7280; }  /* gri     */
.durum-onay,       .durum-mor     { background: #7c3aed; }  /* mor (yönetici onayı) */
.durum-odeme,      .durum-kirmizi { background: #dc2626; }  /* kırmızı */
.durum-turuncu                    { background: #ea580c; }  /* turuncu (yedek) */
.durum-iade                    { background: #dc2626; }  /* turuncu (yedek) */

/* Tür etiketleri: hücreyi taban-tavan TAM kaplar. Bir caride birden çok tür varsa
   bloklar hücreyi dikeyde eşit böler (birlikte doldurur). Renk inline style'dan (tür paleti). */
td:has(> .tur-wrap) {
    padding: 0 !important;
    height: 1px;
    vertical-align: middle;
}
.tur-wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 44px;
}
.tur-blok {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 0;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
}

/* Satır içi köşesiz dikdörtgen etiket (yedek; tam-dolan uygun olmayan yerler için). */
.etiket-blok {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 0;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
}

/* Görevler kartı satır ikonları: küçük yuvarlak-köşeli, açık zemin + renkli ikon. */
.gorev-ikon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    margin-right: 10px;
    font-size: 15px;
    flex: 0 0 auto;
}
.gorev-ikon.ikon-mavi    { background: #dbeafe; color: #2563eb; }
.gorev-ikon.ikon-teal    { background: #ccfbf1; color: #0d9488; }
.gorev-ikon.ikon-turuncu { background: #ffedd5; color: #ea580c; }
.gorev-ikon.ikon-mor     { background: #ede9fe; color: #7c3aed; }
.gorev-ikon.ikon-yesil   { background: #dcfce7; color: #16a34a; }
.gorev-ikon.ikon-kirmizi { background: #fee2e2; color: #dc2626; }

/* Görevler: yan yana kartlar (dikey liste yerine). */
.gorev-kartlar { display: flex; flex-wrap: wrap; gap: 14px; }
.gorev-kart {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 190px;
    min-width: 180px;
    max-width: 280px;
    padding: 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .15s ease, border-color .15s ease;
}
.gorev-kart:hover { border-color: #c7d2fe; box-shadow: 0 2px 10px rgba(0,0,0,.06); color: inherit; }
.gorev-kart .gorev-ikon { margin-right: 0; width: 40px; height: 40px; font-size: 17px; }
.gorev-kart .gorev-metin { font-weight: 600; color: #374151; line-height: 1.25; }
.gorev-kart .gorev-adet { font-weight: 700; font-size: 1.15rem; color: #111827; }

/* Ödemeler Durum hücresi: badge hücreyi TAM kaplar, seçim kutucuğu yanında (üstüne binmez). */
td:has(> .odeme-durum-wrap) {
    padding: 0 !important;
    height: 1px;
    vertical-align: middle;
}
.odeme-durum-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
    height: 100%;
    min-height: 44px;
}
/* Badge tüm hücreyi kaplar; kutucuk mor zeminin SAĞINA biner (mor arka plan üstünde). */
.odeme-durum-wrap > .durum-etiket { flex: 1 1 auto; width: 100%; padding-right: 34px; }
.odeme-durum-wrap > .odeme-sec {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    z-index: 2;
}
/* Personel listesi: sütun başlıkları tek satırda kalsın (alt satıra kaymasın). */
#primaryTable thead th { white-space: nowrap !important; }
#primaryTable tbody td { white-space: nowrap; }

/* Stok Logu: satırları iyice inceltme (sıkı dolgu + küçük rozet + küçük font). */
#datatable-stok-log td, #datatable-stok-log th { padding-top: 5px; padding-bottom: 5px; font-size: 14px; line-height: 1.3; }
#datatable-stok-log .durum-etiket { min-height: 28px; padding-top: 2px; padding-bottom: 2px; font-size: 12px; }

/* Tüp Stok Yaşlandırma: en üstteki sabit SUPRAGAZ satırı (kendi deposu). */
#datatable-ecommerce-list thead tr.supragaz-sabit td {
    background: #fff5f5;
    border-top: 2px solid #dc2626;
    font-weight: 600;
}

/* Çizgili/kutulu rapor tabloları: .tablo-kutulu eklenen sayfalar (tüp/stok/kira
   raporları). Her hücreye dikey + yatay çizgi, başlıklar gri kutu, dikey ortalı.
   Paylaşılan id'ye değil SINIFA bağlı; başka sayfalar (ör. Satış Faturaları)
   aynı id'yi kullansa da etkilenmez. */
.tablo-kutulu { border: 1px solid #cdd3da !important; }
.tablo-kutulu th,
.tablo-kutulu td { border: 1px solid #dee2e6 !important; vertical-align: middle; }
.tablo-kutulu thead th { background-color: #f1f3f5 !important; }

/* ---- PROJE GENELİ RAPOR SATIR RENKLERİ (ZeynERP kalıbı) ----
   Toplam/sonuç satırları SOLID markamavi; ara toplamlar açık mavi; "belirgin gri"
   (ZeynERP'teki alternan satır grisi) #e0e0e0. Hem bu sınıflar hem de rapor
   tablolarındaki <tfoot> (genel toplam satırı) otomatik renklenir. Marka mavi
   = #0070c0 (PDF/Excel export ile birebir aynı). */
.rapor-toplam, .rapor-toplam td, .rapor-toplam th,
.tablo-kutulu tfoot tr, .tablo-kutulu tfoot td, .tablo-kutulu tfoot th {
    background-color: #0070c0 !important;
    color: #fff !important;
    font-weight: 700 !important;
}
.rapor-aratoplam, .rapor-aratoplam td, .rapor-aratoplam th {
    background-color: #d6e4f0 !important;
    color: #0b3d66 !important;
    font-weight: 700 !important;
}
.rapor-gri, .rapor-gri td, .rapor-gri th {
    background-color: #e0e0e0 !important;
    color: #1b1b1b !important;
    font-weight: 600 !important;
}
/* Tablo gövde yazıları PROJE GENELİ belirgin: striped gri satırlarda da net/koyu okunur.
   Tüm Bootstrap tablolarına uygulanır. !important YOK → .text-danger/.text-success
   (renkli tutarlar), fw-bold ve link/buton renkleri kendi değerini korur. */
.table tbody td { color: #1b1b1b; font-weight: 600; }

/* İK Tanımları tablo başlıkları: ZeynERP çelik mavisi (parlak primary yerine). */
.ik-th { background: #4a7ebb !important; color: #fff !important; border-color: #4a7ebb !important; font-weight: 600; }

/* YALNIZCA Tüp Stok Yaşlandırma raporu (.tup-yaslandirma): başlıklar ortalı,
   ilk sütun (Cari) alt satıra kayabilir ve sıralama oku "Cari" metninin yanında.
   Bu kurallar başka tablolara (paylaşılan id) sızmasın diye özel sınıfta. */
.tup-yaslandirma thead th { text-align: center; }
.tup-yaslandirma thead th:first-child { text-align: left; }
.tup-yaslandirma td:first-child { white-space: normal; }
.tup-yaslandirma thead tr > th:first-child { padding-right: 8px; }
.tup-yaslandirma thead tr > th:first-child::before,
.tup-yaslandirma thead tr > th:first-child::after {
    right: auto !important;
    left: 3.6em !important;
}

/* Stok Maliyeti: 4 sütun tam genişlikte gerilip çok geniş oluyordu. Sabit, kompakt
   düzen: tablo ~720px, Ürün makul, numerik sütunlar dar. */
/* İçeriğe göre daralt: tablo içeriği kadar; sayısal sütunlar değerine göre büzülür,
   "28" gibi kısa değerlerin yanında kocaman boşluk kalmaz. Ürün sütunu sabit ~240px,
   uzun adlar alt satıra kayar (sütun gereksiz genişlemez). */
/* Sabit düzen + sabit genişlik + !important: DataTables'ın table{width:100%} ve TH'lere
   JS ile bastığı inline genişlikleri geçersiz kılar. Ürün makul, sayısal sütunlar dar. */
#datatable-ecommerce-list.stok-maliyeti { width: 100% !important; max-width: 100%; table-layout: fixed !important; }
#datatable-ecommerce-list.stok-maliyeti th:nth-child(1),
#datatable-ecommerce-list.stok-maliyeti td:nth-child(1) { width: 52% !important; white-space: normal; }
#datatable-ecommerce-list.stok-maliyeti th:nth-child(2),
#datatable-ecommerce-list.stok-maliyeti td:nth-child(2) { width: 12% !important; }
#datatable-ecommerce-list.stok-maliyeti th:nth-child(3),
#datatable-ecommerce-list.stok-maliyeti td:nth-child(3) { width: 18% !important; }
#datatable-ecommerce-list.stok-maliyeti th:nth-child(4),
#datatable-ecommerce-list.stok-maliyeti td:nth-child(4) { width: 18% !important; }

/* ── Supragaz tablo standardı ───────────────────────────────────────────────
   Sayı (ve opt-in tarih) sütunları uygulama genelinde tek tip: ortalanmış ve
   İÇERİK GENİŞLİĞİNDE (sütun içeriğe göre daralır, kenarda boşluk kalmaz).
   Hedef SADECE güvenilir sayısal işaretçiler: .text-end ve .num-cell (hem th
   hem td). Bu ikisi metin sütunlarında kullanılmaz → uzun metin (ünvan, açıklama,
   e-posta, ürün adı) ETKİLENMEZ. DİKKAT: .text-center / .text-nowrap KULLANMA —
   onlar tarih sütunlarıyla birlikte uzun-metin sütunlarında da var; nowrap'a
   zorlanınca yatay taşma yaparlar. Tarihleri daraltmak için ilgili hücreye
   .num-cell EKLE (opt-in; unutulursa sütun sadece geniş kalır, bozulmaz).
   width:1px + nowrap = sütun içeriğin en dar haline iner; !important view'lardaki
   inline/sabit genişlikleri (ör. style="width:200px") de ezer.
   HARİÇ: table-layout:fixed tablolar (MusteriUrunFiyat, StockLocation) ve
   .stok-maliyeti (StockValue) — kendi sütun genişlikleri korunur. */
table:not([style*="table-layout:fixed"]):not([style*="table-layout: fixed"]):not(.stok-maliyeti)
    :is(td, th):is(.text-end, .num-cell) {
    text-align: center !important;
    white-space: nowrap;
    width: 1px !important;
}

/* İSTİSNA — Fatura/irsaliye detay (.invoice) tabloları tema ile table-layout:fixed
   (theme.css ".invoice table.table"). Fixed layout'ta yukarıdaki width:1px sütunu
   1px'e çökertip tutarları taşırıyordu (özet tablo sağdan kesiliyordu). Bu
   tablolarda tutar hücrelerini eski haline al: sağa yaslı + otomatik genişlik.
   Specificity yukarıdaki kuraldan yüksek (.invoice + aynı :not zinciri). */
.invoice table:not([style*="table-layout:fixed"]):not([style*="table-layout: fixed"]):not(.stok-maliyeti)
    :is(td, th):is(.text-end, .num-cell) {
    width: auto !important;
    text-align: right !important;
}

/* ── Dikey sütun ayraçları ───────────────────────────────────────────────────
   Tüm standart tablolarda sütunlar arası ince dikey çizgi (grid görünümü).
   Yatay çizgiler Bootstrap .table'dan gelir; bu yalnız dikeyi ekler. İlk
   sütunda sol çizgi yok (dış kenar çizilmez, yalnız sütunlar ARASI ayraç).
   .tablo-kutulu zaten tam kenarlıklı → onda görsel fark olmaz (aynı renk). */
.table > :is(thead, tbody, tfoot) > tr > td:not(:first-child),
.table > :is(thead, tbody, tfoot) > tr > th:not(:first-child) {
    border-left: 1px solid #dee2e6;
}

/* Sütun başlıkları: her başlık hücresi tam kenarlıklı (grid başlık görünümü).
   !important çünkü tema .table-ecommerce-simple thead th'ye border-top:0 veriyor
   (başlığın ÜST kenarını siliyordu). */
.table > thead > tr > th {
    border: 1px solid #dee2e6 !important;
}

/* Cari özet tabloları: yalnız Bakiye (toplam) satırı renkli. */
.table > tbody > tr.ozet-bakiye > td { background-color: #ffc000; color: #1b1b1b; font-size: 1.05em; box-shadow: none; }

/* Fatura belgesi düğmesi (oluşturma formu ve fatura detayı). */
.btn.fatura-belge-dugme {
    display: inline-flex;
    align-items: center;
    gap: .4em;
    background-color: #c0392b;
    border-color: #c0392b;
    color: #fff;
    font-weight: 600;
    border-radius: .6em;
}
.btn.fatura-belge-dugme i { font-size: 1.5em; line-height: 1; }
.btn.fatura-belge-dugme:hover, .btn.fatura-belge-dugme:focus { background-color: #a93226; border-color: #a93226; color: #fff; }
.btn.fatura-belge-cubuk i { font-size: 1rem; }
