/* help.yazsis.com merkez — özel stiller (Bootstrap 5.3.3 üzerine) */

/* ---------------- Kenar menü ---------------- */
.sidebar .nav-link {
    border-radius: .375rem;
    padding: .45rem .75rem;
}
.sidebar .nav-link.active {
    background-color: var(--bs-primary);
}
.sidebar .nav-link:not(.active):hover {
    background-color: rgba(255, 255, 255, .1);
    color: #fff !important;
}

/* v2.0.0 akordeon menü grupları: başlık düğmesi + açılır/kapanır liste */
.sidebar-grup-baslik {
    display: flex;
    align-items: center;
    width: 100%;
    margin-top: .75rem;
    padding: .3rem .75rem;
    border: 0;
    border-radius: .375rem;
    background: none;
    color: #adb5bd; /* koyu zeminde okunur (text-bg-dark data-bs-theme vermez) */
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    text-align: left;
    cursor: pointer;
}
.sidebar-grup-baslik:hover,
.sidebar-grup-baslik:focus-visible {
    color: #fff;
    background-color: rgba(255, 255, 255, .08);
    outline: none;
}
.sidebar-grup-baslik .bi-chevron-down {
    margin-left: auto;
    font-size: .7rem;
    transition: transform .2s ease;
}
.sidebar-grup.kapali .sidebar-grup-baslik .bi-chevron-down {
    transform: rotate(-90deg);
}
.sidebar-grup.kapali .sidebar-grup-liste {
    display: none;
}
.sidebar-grup-rozet {
    display: none;
    font-size: .65rem;
}
.sidebar-grup.kapali .sidebar-grup-rozet {
    display: inline-block;
}
.sidebar-grup:first-child .sidebar-grup-baslik {
    margin-top: 0;
}

/* Masaüstü (≥768px): offcanvas, sabit tam boy kenar menü gibi davranır */
@media (min-width: 768px) {
    .sidebar.offcanvas-md {
        display: flex;
        flex-direction: column;
        width: 240px;
        flex-shrink: 0;
        height: 100vh;
        position: sticky;
        top: 0;
        background-color: #212529 !important;
        transition: width .2s ease;
    }
    .sidebar .offcanvas-body {
        flex-grow: 1 !important;
    }
    /* Hamburger ile menü gizlendi (body.menu-gizli; çerezle hatırlanır): içerik tam genişlik */
    body.menu-gizli .sidebar.offcanvas-md {
        width: 0;
        overflow: hidden;
        border: 0;
    }
    body.menu-gizli .sidebar.offcanvas-md .offcanvas-body {
        display: none !important;
    }
}
/* Mobil (<768px): kayan panel genişliği */
@media (max-width: 767.98px) {
    .sidebar.offcanvas-md {
        --bs-offcanvas-width: 260px;
    }
}
/* Uzun menüde yalnız liste kayar; alt kısım (sürüm) sabit kalır */
.sidebar .offcanvas-body {
    overflow: hidden;
}
.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    flex-wrap: nowrap;
}
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .2);
    border-radius: 3px;
}

/* v2.0.0 bağlamsal yardım: üst çubukta sayfa adının yanındaki "?" */
.yardim-baglam {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    color: var(--bs-primary);
    font-size: 1.1rem;
    text-decoration: none;
}
.yardim-baglam:hover,
.yardim-baglam:focus-visible {
    background-color: rgba(13, 110, 253, .12);
    color: var(--bs-primary);
    outline: none;
}

/* ---------------- İçerik alanı (yatay taşma koruması) ---------------- */
/* Flex öğesinin min-width:auto değeri geniş tabloyla genişlemesin; tablo kendi içinde kaysın */
.merkez-icerik,
.merkez-icerik > header,
.merkez-icerik > main,
.merkez-icerik > footer {
    min-width: 0;
    max-width: 100%;
}
.min-w-0 {
    min-width: 0;
}
.kullanici-ad {
    max-width: 180px;
}

.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
    min-width: 0;
}

/* ---------------- Giriş sayfası ---------------- */
.giris-logo {
    font-size: 2.5rem;
}

/* ---------------- Yardımcılar ---------------- */
/* Tek seferlik kodlar (eşleştirme / elle kod) — seçilip kopyalanabilir, taşmaz */
.kod-kutu {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    word-break: break-all;
    white-space: pre-wrap;
    user-select: all;
}
.table td,
.table th {
    vertical-align: middle;
}
/* Dar ekranda .text-break hücreleri (konu, ünvan) harf harf kırılmasın: sütuna asgari genişlik ver,
   tablo .table-responsive içinde yatay kaysın */
.table-responsive .table td.text-break,
.table-responsive .table th.text-break {
    min-width: 14rem;
}

/* ---------------- Talepler (v1.1.0) — personel ve müşteri görünümleri ortak ---------------- */
/* Mesaj akışı: <div class="talep-mesaj talep-mesaj-musteri|talep-mesaj-yazsis|talep-mesaj-sistem|talep-mesaj-ic-not"> */
.talep-mesaj {
    border-radius: .5rem;
    padding: .75rem 1rem;
    margin-bottom: .75rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
}
.talep-mesaj-govde {
    white-space: pre-wrap;
    word-break: break-word;
}
.talep-mesaj-musteri {
    border-left: 4px solid var(--bs-primary);
}
.talep-mesaj-yazsis {
    border-left: 4px solid var(--bs-success);
    background: #f6fbf7;
}
.talep-mesaj-sistem {
    border: 1px dashed rgba(0, 0, 0, .15);
    background: transparent;
    color: var(--bs-secondary-color);
    font-size: .875rem;
    text-align: center;
    padding: .4rem .75rem;
}
/* İç not: yalnız personel görür (müşteriye ASLA basılmaz) */
.talep-mesaj-ic-not {
    border-left: 4px solid var(--bs-warning);
    background: #fff8e1;
}
/* SLA: aşıldı / yaklaşıyor */
.sla-asildi {
    color: var(--bs-danger);
    font-weight: 600;
}
.sla-yakin {
    color: #b35c00;
}
tr.sla-asildi-satir > td {
    background-color: rgba(var(--bs-danger-rgb), .06);
}
/* Müşteri paneli üst çubuğu */
.musteri-firma {
    max-width: 260px;
}
.guncelleme-bandi .btn {
    white-space: nowrap;
}

/* ---------------- Tahsilat (D) — liste / firma sekmesi / pano kartı ortak ---------------- */
/* Vadesi geçen açık tahsilat satırı: kırmızı sol şerit */
tr.vade-gecti > td {
    background-color: rgba(var(--bs-danger-rgb), .04);
}
tr.vade-gecti > td:first-child {
    box-shadow: inset 4px 0 0 var(--bs-danger);
}
/* Detay sayfası: ödenen / tutar ilerleme çubuğu */
.tahsilat-ilerleme {
    height: .5rem;
    max-width: 320px;
}

/* ---------------- CRM (v1.2.0) — ortak sınıflar; sayfaya özel stiller konu ajanlarının dosyalarında ---------------- */
/* Öncelik puanı rozeti: <span class="badge puan-rozet puan-yuksek|puan-orta|puan-dusuk">72</span> */
.puan-rozet {
    min-width: 2.25rem;
    font-variant-numeric: tabular-nums;
}
.puan-yuksek { background-color: var(--bs-success); color: #fff; }
.puan-orta   { background-color: var(--bs-warning); color: #212529; }
.puan-dusuk  { background-color: var(--bs-secondary); color: #fff; }

/* Firma etiketleri (KC26) ve yazışmadaki @etiket vurgusu (KC20) */
.etiket-rozet {
    display: inline-block;
    padding: .1rem .5rem;
    margin: 0 .2rem .2rem 0;
    border-radius: 1rem;
    font-size: .8rem;
    background: #eef2f7;
    border: 1px solid rgba(0, 0, 0, .08);
    color: #33415c;
    text-decoration: none;
}
a.etiket-rozet:hover { background: #dde5f0; }

/* Firma durumu (v2.1.0): "İş yapmaz" rozeti / seçim düğmesi — koyu turuncu (beyaz metin, kontrast ≥ 4.5) */
.ilgi-is-yapmaz { background-color: #b45309; color: #fff; }
.btn-outline-ilgi-is-yapmaz {
    --bs-btn-color: #b45309;
    --bs-btn-border-color: #b45309;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #b45309;
    --bs-btn-hover-border-color: #b45309;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #9a4507;
    --bs-btn-active-border-color: #9a4507;
    --bs-btn-focus-shadow-rgb: 180, 83, 9;
}
/* Seçim düğmeleri dar ekranda kaydırmasız sarar; seçili olan kalın */
.ilgi-secim .btn { white-space: nowrap; }
.ilgi-secim .btn-check:checked + .btn { font-weight: 600; }
/* Rapor tablolarında durum sütun başlıkları ve pay çubuğu (<progress class="ilgi-pay">) */
.ilgi-baslik { white-space: nowrap; font-weight: 600; }
.ilgi-pay { width: 4.5rem; height: .5rem; vertical-align: middle; }

/* İletişim izni RET uyarısı (KC25) */
.izin-ret {
    border-left: 4px solid var(--bs-danger);
    background: rgba(var(--bs-danger-rgb), .06);
}

/* Fırsat aşama çubuğu (KC10): <ol class="asama-cubuk"><li class="gecti|aktif|kazanildi|kaybedildi">…</li></ol> */
.asama-cubuk {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}
.asama-cubuk > li {
    flex: 1 1 0;
    min-width: 6rem;
    padding: .4rem .6rem;
    text-align: center;
    font-size: .875rem;
    border-radius: .375rem;
    background: #e9ecef;
    color: var(--bs-secondary-color);
}
.asama-cubuk > li.gecti      { background: rgba(var(--bs-primary-rgb), .15); color: var(--bs-primary); }
.asama-cubuk > li.aktif      { background: var(--bs-primary); color: #fff; font-weight: 600; }
.asama-cubuk > li.kazanildi  { background: var(--bs-success); color: #fff; font-weight: 600; }
.asama-cubuk > li.kaybedildi { background: var(--bs-danger); color: #fff; font-weight: 600; }

/* Fırsat panosu sütunları ve kartları */
.firsat-pano {
    display: grid;
    grid-template-columns: repeat(4, minmax(14rem, 1fr));
    gap: .75rem;
    overflow-x: auto;
}
.firsat-kart {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
    border-radius: .5rem;
    padding: .6rem .75rem;
    margin-bottom: .5rem;
}
.firsat-kart.gecikmis { border-left: 4px solid var(--bs-danger); }
/* --- CRM F --- kapalı aşamalar da gösterilince 6 sütun (KAZANILDI / KAYBEDILDI) */
.firsat-pano.firsat-pano-6 { grid-template-columns: repeat(6, minmax(13rem, 1fr)); }
/* --- /CRM F --- */

/* Hatırlatıcı: geciken satır */
.hatirlatici-geciken { color: var(--bs-danger); font-weight: 600; }

/* Kayıt üzerinde yazışma (KC20) */
.yazisma-ileti {
    border-radius: .5rem;
    padding: .6rem .9rem;
    margin-bottom: .6rem;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .08);
}
.yazisma-ileti.soru   { border-left: 4px solid var(--bs-warning); background: #fff8e1; }
.yazisma-ileti.cozuldu { border-left: 4px solid var(--bs-success); }

/* Türkiye il haritası (KC16): SVG sayfaya satır içi gömülür; il <g>'lerine yogunluk-0..4 sınıfı verilir */
.tr-harita svg {
    width: 100%;
    height: auto;
    display: block;
}
.tr-harita g[data-plakakodu] path {
    stroke: #fff;
    stroke-width: .6;
    transition: fill .15s ease-in-out;
}
.tr-harita .yogunluk-0 path { fill: #e9ecef; }
.tr-harita .yogunluk-1 path { fill: #cfe2ff; }
.tr-harita .yogunluk-2 path { fill: #9ec5fe; }
.tr-harita .yogunluk-3 path { fill: #3d8bfd; }
.tr-harita .yogunluk-4 path { fill: #0a58ca; }
.tr-harita a:hover path,
.tr-harita g[data-plakakodu]:hover path { fill: #fd7e14; cursor: pointer; }
.tr-harita .hidden { display: none; }
.harita-lejant span {
    display: inline-block;
    width: 1.25rem;
    height: .75rem;
    margin-right: .25rem;
    border-radius: .15rem;
    vertical-align: middle;
}
.harita-lejant .yogunluk-0 { background: #e9ecef; }
.harita-lejant .yogunluk-1 { background: #cfe2ff; }
.harita-lejant .yogunluk-2 { background: #9ec5fe; }
.harita-lejant .yogunluk-3 { background: #3d8bfd; }
.harita-lejant .yogunluk-4 { background: #0a58ca; }

/* İl sayfası nokta haritası (Leaflet kabı) */
.nokta-harita {
    height: 32rem;
    min-height: 20rem;
    border-radius: .5rem;
    border: 1px solid rgba(0, 0, 0, .1);
    z-index: 0;
}

/* Yazdırma layout'u (layouts/yazdir.php, KC31) */
.yazdir-icerik {
    max-width: 210mm;
    margin: 0 auto;
    padding: 1rem;
}

@media print {
    .sidebar, header, footer, .btn, .alert, .pagination {
        display: none !important;
    }
    .yazdir-icerik {
        max-width: none;
        padding: 0;
    }
}

/* --- CRM H --- (KC15 / KC16) il haritası ipucu + vurgu, il sayfası nokta lejantı ve popup */
.tr-harita g[data-plakakodu]:focus { outline: none; }
.tr-harita g[data-plakakodu].vurgu path,
.tr-harita g[data-plakakodu]:focus path { fill: #fd7e14; }
.harita-ipucu {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    background: rgba(33, 37, 41, .92);
    color: #fff;
    font-size: .8rem;
    line-height: 1.3;
    padding: .35rem .55rem;
    border-radius: .3rem;
    white-space: nowrap;
    box-shadow: 0 .25rem .5rem rgba(0, 0, 0, .2);
}
.nokta-ornek {
    display: inline-block;
    width: .8rem;
    height: .8rem;
    border-radius: 50%;
    border: 1.5px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
    vertical-align: -.1rem;
    margin: 0 .2rem 0 .5rem;
}
.nokta-aday    { background: #0d6efd; }
.nokta-musteri { background: #198754; }
.nokta-eski    { background: #6c757d; }
.nokta-bolge   { background: rgba(111, 66, 193, .35); border-color: #6f42c1; }
.nokta-popup   { min-width: 12rem; }
.leaflet-container { font: inherit; }
/* Yaklaşık konum (şema 10): içi boş daire + kesikli küme (crm-harita.js yaklasikKume) */
.nokta-yaklasik { background: #fff; border: 2px solid #6c757d; box-shadow: none; }
.marker-cluster-yaklasik { background-color: rgba(108, 117, 125, .18) !important; }
.marker-cluster-yaklasik div { background-color: rgba(255, 255, 255, .92) !important; border: 2px dashed #6c757d; }
.marker-cluster-yaklasik span { color: #495057; }
/* --- /CRM H --- */

/* --- E-posta (C) --- şablon / tek tık / gönderim detayı önizleme kutusu, düz metin görünümü, durum rozetleri */
.eposta-onizleme {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    padding: 1rem;
    max-height: 60vh;
    overflow: auto;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #212529;
}
.eposta-onizleme img { max-width: 100%; height: auto; }
.eposta-onizleme .ek-metin { background: #fff8e1; border-left: 3px solid #ffc107; padding: .5rem .75rem; }
.eposta-onizleme .yazsis-altbilgi { background: #f8f9fa; padding: .5rem .75rem; border-radius: .25rem; }
.eposta-metin {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: .85rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    padding: .75rem;
    max-height: 60vh;
    overflow: auto;
}
#adimTablosu input[type="number"] { max-width: 120px; }
/* --- /E-posta (C) --- */
