/* KurumsalPortal — özel stiller */

.sidebar .nav-link.active {
    background-color: var(--bs-primary);
}

.sidebar .nav-link:not(.active):hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff !important;
}

/* ---------------- Kenar menü (responsive) ---------------- */
/* Masaüstü (≥768px): offcanvas, sabit tam boy sidebar gibi davranır */
@media (min-width: 768px) {
    .sidebar.offcanvas-md {
        display: flex;
        flex-direction: column;
        width: 250px;
        flex-shrink: 0;
        height: 100vh;
        position: sticky;
        top: 0;
        background-color: #212529 !important; /* text-bg-dark koyu zemin korunur */
    }
    .sidebar .offcanvas-body {
        flex-grow: 1 !important;
    }
}
/* Mobil (<768px): kayan offcanvas panel genişliği */
@media (max-width: 767.98px) {
    .sidebar.offcanvas-md {
        --bs-offcanvas-width: 260px;
    }
}
/* Uzun menüde yalnızca liste kayar; alt kısım (profil/çıkış) 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; /* Bootstrap .nav wrap'i: uzun menü 2. sütuna sarmasın, dikey kaysın */
}
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* ---------------- İçerik alanı (yatay taşma koruması) ---------------- */
/* Flex öğesinin varsayılan min-width:auto değeri, içerideki geniş tablo
   kadar genişlemesine yol açıyor ve .table-responsive kırpamıyordu.
   min-width:0 ile içerik sütunu kalan alana sığar, tablo kendi içinde kayar. */
.portal-content {
    min-width: 0;
    max-width: 100%;
}
.portal-content > header,
.portal-content > main,
.portal-content > footer {
    min-width: 0;
}

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

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
}

@media print {
    .sidebar, header, footer, .btn, .alert {
        display: none !important;
    }
}

/* ---------------- Dashboard ---------------- */
.dash-hero {
    background: linear-gradient(120deg, #0d6efd 0%, #6610f2 100%);
    color: #fff;
    border-radius: 14px;
    padding: 22px 26px;
}
.dash-hero h3 { margin: 0; font-weight: 700; }
.dash-hero .chip {
    background: rgba(255,255,255,.18);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: .85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.dash-hero .chip a, .dash-hero .chip { color: #fff; text-decoration: none; }

.kpi-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: transform .12s ease, box-shadow .12s ease;
    height: 100%;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,.10); }
.kpi-card .kpi-body { display: flex; align-items: center; gap: 14px; padding: 16px; }
.kpi-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; flex-shrink: 0;
}
.kpi-value { font-size: 1.7rem; font-weight: 700; line-height: 1; }
.kpi-label { font-size: .82rem; color: #6c757d; }

.kpi-primary  .kpi-icon { background: #cfe2ff; color: #0d6efd; }
.kpi-success  .kpi-icon { background: #d1e7dd; color: #198754; }
.kpi-warning  .kpi-icon { background: #fff3cd; color: #997404; }
.kpi-danger   .kpi-icon { background: #f8d7da; color: #dc3545; }
.kpi-info     .kpi-icon { background: #cff4fc; color: #087990; }
.kpi-purple   .kpi-icon { background: #e2d9f3; color: #6f42c1; }
.kpi-dark     .kpi-icon { background: #ced4da; color: #212529; }

/* DIKKAT: .widget-card ustune height/min-height VERMEYIN.
   Kart dogrudan <main> icinde kullanildiginda main esnek (flex) bir oge oldugu icin
   yuksekligi kesindir; height:100% o zaman "sayfa boyu kadar kart" anlamina gelir ve
   sayfa asagi dogru uzayip gider. Yan yana kartlarda esit yukseklik gerekiyorsa
   satir icindeki karta Bootstrap .h-100 sinifini ekleyin. */
.widget-card { border: none; border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.widget-card .card-header {
    background: #fff; border-bottom: 1px solid #eee; font-weight: 600;
    border-radius: 12px 12px 0 0; display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: .5rem; /* dar ekranda başlık + aksiyon alt alta geçsin, taşmasın */
}
.widget-list .item { padding: 9px 0; border-bottom: 1px solid #f1f1f1; }
.widget-list .item:last-child { border-bottom: none; }

.mini-bar { height: 8px; border-radius: 4px; background: #eee; overflow: hidden; }
.mini-bar > span { display: block; height: 100%; }

.timeline-item { position: relative; padding-left: 18px; padding-bottom: 12px; }
.timeline-item::before {
    content: ''; position: absolute; left: 0; top: 4px;
    width: 9px; height: 9px; border-radius: 50%; background: #0d6efd;
}
.timeline-item::after {
    content: ''; position: absolute; left: 4px; top: 12px; bottom: 0; width: 1px; background: #e0e0e0;
}
.timeline-item:last-child::after { display: none; }

/* Flex çocuğunun içeriğinden dar kalabilmesi için (text-truncate ile birlikte kullanılır) */
.min-w-0 { min-width: 0; }

/* ================= Mobil uyum (v1.5.1) ================= */
/* Bootstrap .badge varsayilani white-space:nowrap - dar ekranda satiri tasiriyordu */
.badge { white-space: normal; }
/* Sabit px genisligi verilen ilerleme cubuklari kapsayicidan tasmasin */
.progress { max-width: 100%; }
/* Gorsel ve tuvaller kapsayiciyi asmasin */
main img, main canvas, main svg { max-width: 100%; }
/* Kesintisiz uzun metin (e-posta, URL) kutuyu tasirmasin */
.text-break-anywhere { overflow-wrap: anywhere; }

@media (max-width: 767.98px) {
    /* iOS odaklanmada sayfayi yakinlastirmasin: form yazisi >= 16px olmali */
    .form-control, .form-select,
    .form-control-sm, .form-select-sm { font-size: 1rem; }
    /* Dokunma hedefi ~44px (btn-sm yogun tablolarda ~36px) */
    .btn { --bs-btn-padding-y: .55rem; }
    .btn-sm { --bs-btn-padding-y: .4rem; }
    .form-control, .form-select { padding-top: .5rem; padding-bottom: .5rem; }
    .form-control-sm, .form-select-sm { padding-top: .4rem; padding-bottom: .4rem; }
    /* Dashboard mobilde daha derli toplu */
    .dash-hero { padding: 16px 18px; border-radius: 12px; }
    .dash-hero h3 { font-size: 1.25rem; }
    .kpi-value { font-size: 1.45rem; }
    .kpi-icon { width: 42px; height: 42px; font-size: 1.2rem; }
    .kpi-card .kpi-body { gap: 10px; padding: 12px; }
}

@media print {
    /* Kaydirmali tablo yazdirmada kirpilmasin */
    .table-responsive { overflow: visible !important; }
}

@media (max-width: 767.98px) {
    /* .input-group-sm > .form-* Bootstrap kurali ozgullukte oncekini yeniyordu (14px kaliyordu) */
    .input-group-sm > .form-control,
    .input-group-sm > .form-select,
    .input-group-sm > .btn,
    .input-group-sm > .input-group-text { font-size: 1rem; }
    /* .py-0 / .p-0 yardimcilari !important ile dolguyu sifirliyor -> dokunma hedefi 23px kaliyordu */
    .btn.py-0, .btn.p-0, .btn.pt-0, .btn.pb-0 {
        padding-top: .4rem !important;
        padding-bottom: .4rem !important;
    }
    /* .btn-group-sm > .btn de ozgullukte oncekini yeniyordu */
    .btn-group-sm > .btn { --bs-btn-padding-y: .4rem; }
    /* Fotograf uzerindeki yuvarlak kucuk islem butonu parmakla secilebilsin */
    .btn.rounded-circle.p-1 { width: 36px !important; height: 36px !important; padding: 0 !important; }
    /* btn-link satir ici islem butonlari da parmakla secilebilsin */
    .btn-link.btn-sm { padding-top: .4rem; padding-bottom: .4rem; }
}

/* Antet logosu kenar menüde (v1.8.0) — koyu zeminde her logo okunsun diye
   açık renk bir çip içine alınır. Belgelerde logo beyaz kâğıda basıldığı için
   koyu çizilir; aynı dosya koyu menüde kaybolmasın. */
.marka-cip {
    display: inline-flex;
    align-items: center;
    background: #fff;
    border-radius: 8px;
    padding: 4px 9px;
    line-height: 0;
}
