/* ============================================
   KKU Genel Modal Sistemi - Modern KKU Kırmızı Tema
   Modern, animasyonlu ve responsive modal
   Renk token'ları: kku-modal-headers-brand.css (:root)
   ============================================ */

/* Modal Overlay */
.kku-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    backdrop-filter: none;
    overflow-y: auto;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

    .kku-modal.show {
        display: flex;
    }

/* Modal Content */
.kku-modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 8px;
    padding: 0;
    min-width: 400px;
    min-height: 400px;
    max-width: 550px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    margin: auto;
    animation: kkuModalPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(220, 38, 38, 0.35);
    border: none;
    transform-origin: center center;
    display: flex;
    flex-direction: column;
}

    /* Modal Boyutları */
    .kku-modal-content.small {
        min-width: 350px;
        max-width: 400px;
        min-height: 250px;
    }

    .kku-modal-content.medium {
        min-width: 450px;
        max-width: 600px;
        min-height: 400px;
    }

    .kku-modal-content.large {
        min-width: 600px;
        max-width: 800px;
        min-height: 400px;
    }

    .kku-modal-content.xlarge {
        min-width: 800px;
        max-width: 1000px;
        min-height: 500px;
    }

    .kku-modal-content.fullscreen {
        min-width: 90%;
        max-width: 95%;
        min-height: 90vh;
        max-height: 95vh;
        width: 95%;
    }

/* Modal Header */
.kku-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: var(--kku-modal-header-gradient, linear-gradient(90deg, #6f1418 0%, #b42828 42%, #1e3d62 88%, #1a2942 100%));
    color: var(--kku-modal-header-text, #fff);
    margin-bottom: 0;
    border-bottom: none;
    position: relative;
    overflow: hidden;
    min-height: 60px;
    flex-shrink: 0;
    cursor: move;
    user-select: none;
    touch-action: none;
}

[class$="-modal-header"]:not(.kku-modal-header) {
    cursor: move;
    user-select: none;
    touch-action: none;
}

.kku-modal-header-actions,
.kku-modal-header-actions *,
[class*="modal-header-actions"],
[class*="modal-header-actions"] * {
    cursor: pointer;
    touch-action: auto;
}

.kku-modal-content.kku-modal-positioned,
[class$="-modal-content"].kku-modal-positioned,
[class$="-modal-dialog"].kku-modal-positioned {
    margin: 0;
}

.kku-modal-content.kku-modal-dragging,
[class$="-modal-content"].kku-modal-dragging,
[class$="-modal-dialog"].kku-modal-dragging {
    transition: none !important;
    animation: none !important;
}

body.kku-modal-drag-active {
    user-select: none;
}

    .kku-modal-header::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="20" height="20" patternUnits="userSpaceOnUse"><path d="M 20 0 L 0 0 0 20" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
        opacity: 0.3;
    }

.kku-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    margin: 0;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .kku-modal-title::before {
        content: '';
        width: 3px;
        height: 20px;
        background: rgba(255, 255, 255, 0.5);
        border-radius: 2px;
    }

    .kku-modal-title i {
        color: rgba(255, 255, 255, 0.9);
    }

/* Başlık sağ: tam ekran + kapat */
.kku-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.kku-modal-expand {
    background: var(--kku-modal-header-action-bg, rgba(255, 255, 255, 0.14));
    border: 1px solid var(--kku-modal-header-action-border, rgba(255, 255, 255, 0.28));
    font-size: 0.95rem;
    color: #fff;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(10px);
    line-height: 1;
}

    .kku-modal-expand:hover {
        background: var(--kku-modal-header-action-bg-hover, rgba(255, 255, 255, 0.26));
        border-color: rgba(255, 255, 255, 0.45);
        color: #fff;
        transform: scale(1.04);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    .kku-modal-expand[aria-pressed="true"] {
        background: var(--kku-modal-header-action-bg-hover, rgba(255, 255, 255, 0.26));
        border-color: rgba(255, 255, 255, 0.4);
    }

/* İstatistik modal: dünya haritasını tam sayfada aç (başlık sağı, genişlet ile aynı boyut) */
a.kku-modal-header-fullpage {
    text-decoration: none;
    box-sizing: border-box;
    background: var(--kku-modal-header-action-bg, rgba(255, 255, 255, 0.14));
    border: 1px solid var(--kku-modal-header-action-border, rgba(255, 255, 255, 0.28));
    font-size: 0.95rem;
    color: #fff;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(10px);
    line-height: 1;
}

    a.kku-modal-header-fullpage:hover {
        background: var(--kku-modal-header-action-bg-hover, rgba(255, 255, 255, 0.26));
        border-color: rgba(255, 255, 255, 0.45);
        color: #fff;
        transform: scale(1.04);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    a.kku-modal-header-fullpage[hidden] {
        display: none !important;
    }

/* Açık arka planlı modal başlıkları (personel vb.) */
.kku-modal-expand--light {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
}

    .kku-modal-expand--light:hover {
        background: #e2e8f0;
        border-color: #cbd5e1;
        color: #1e293b;
        transform: scale(1.05);
    }

    .kku-modal-expand--light[aria-pressed="true"] {
        background: #e2e8f0;
        border-color: #94a3b8;
        color: #0f172a;
    }

/* Tam ekrana yakın genişletme (içerik) */
.kku-modal.kku-modal-maximized-shell {
    padding: 0.35rem;
    align-items: stretch;
    justify-content: center;
}

.kku-modal-content.kku-modal-maximized {
    width: min(100vw - 0.75rem, 100%) !important;
    max-width: min(100vw - 0.75rem, 100%) !important;
    min-width: min(320px, 100%) !important;
    height: min(100dvh - 0.75rem, 100%) !important;
    max-height: min(100dvh - 0.75rem, 100%) !important;
    min-height: min(400px, 100dvh - 1rem) !important;
    margin: 0 auto !important;
    border-radius: 6px;
}

    .kku-modal-content.kku-modal-maximized .kku-modal-body {
        max-height: none !important;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }

/* Genişletilmiş modal: ağaç/liste gövdesi kalan yüksekliği doldurur (altta boş beyaz şerit kalmaz) */
.kku-modal-content.kku-modal-maximized .kku-modal-body:has(.bolum-tree-container),
.kku-modal-content.kku-modal-maximized .kku-modal-body:has(.program-tree-container),
.kku-modal-content.kku-modal-maximized .kku-modal-body:has(.fakulte-list-container) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.kku-modal-content.kku-modal-maximized .kku-modal-body:has(.bolum-tree-container) > .stats-source-banner,
.kku-modal-content.kku-modal-maximized .kku-modal-body:has(.program-tree-container) > .stats-source-banner,
.kku-modal-content.kku-modal-maximized .kku-modal-body:has(.fakulte-list-container) > .stats-source-banner {
    flex-shrink: 0;
}

.kku-modal-content.kku-modal-maximized .bolum-tree-container,
.kku-modal-content.kku-modal-maximized .program-tree-container,
.kku-modal-content.kku-modal-maximized .fakulte-list-container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.kku-modal-content.kku-modal-maximized .bolum-tree-list,
.kku-modal-content.kku-modal-maximized .program-tree-list,
.kku-modal-content.kku-modal-maximized .fakulte-list-grid {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow-y: auto;
}

/* İstatistik ağaç/liste modalları: yükseklik sabitle → scroll alanı footer üstünde biter, son kart görünür */
.kku-modal-content.large:has(.bolum-tree-container),
.kku-modal-content.large:has(.program-tree-container),
.kku-modal-content.large:has(.fakulte-list-container),
.kku-modal-content.medium:has(.bolum-tree-container),
.kku-modal-content.medium:has(.program-tree-container),
.kku-modal-content.medium:has(.fakulte-list-container),
.kku-modal-content.xlarge:has(.bolum-tree-container),
.kku-modal-content.xlarge:has(.program-tree-container),
.kku-modal-content.xlarge:has(.fakulte-list-container) {
    min-height: 0;
    height: min(92dvh, 920px);
    max-height: min(92dvh, 920px);
}

/* Stats modal: overlay kaymasın; tek iç scroll (personel/fakülte listesi) */
#stats-modal.show {
    overflow: hidden;
    overscroll-behavior: none;
}

#stats-modal .kku-modal-content:has(.bolum-tree-container),
#stats-modal .kku-modal-content:has(.fakulte-list-container),
#stats-modal .kku-modal-content:has(.program-tree-container) {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#stats-modal .kku-modal-body:has(.bolum-tree-container),
#stats-modal .kku-modal-body:has(.fakulte-list-container),
#stats-modal .kku-modal-body:has(.program-tree-container) {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow: hidden !important;
}

#stats-modal .bolum-tree-container,
#stats-modal .fakulte-list-container,
#stats-modal .program-tree-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
}

#stats-modal .bolum-tree-list,
#stats-modal .fakulte-list-grid,
#stats-modal .program-tree-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none !important;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 3.25rem;
    scroll-padding-bottom: 3.25rem;
}

#stats-modal #akademik-personel-search-results,
#stats-modal #idari-personel-search-results {
    flex-shrink: 0;
}

#stats-modal .personel-birim-staff {
    padding-bottom: 0.85rem;
}

#stats-modal .personel-birim-staff > .bolum-tree-item:last-child {
    margin-bottom: 0.35rem;
}

#stats-modal .bolum-tree-fakulte.expanded > .bolum-tree-bolumler {
    padding-bottom: 0.85rem;
}

/* Personel modalları: gövde sınıfı farklı */
.kku-modal-content.kku-modal-maximized .personel-biyografi-modal-body,
.kku-modal-content.kku-modal-maximized .personel-qr-modal-body {
    max-height: none !important;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.personel-biyografi-modal-content.kku-modal-maximized,
.personel-qr-modal-content.kku-modal-maximized {
    max-width: min(100vw - 0.75rem, 100%) !important;
    width: min(100vw - 0.75rem, 100%) !important;
    max-height: min(100dvh - 0.75rem, 100%) !important;
    height: min(100dvh - 0.75rem, 100%) !important;
}

#stats-modal .kku-modal-content.kku-modal-maximized,
#stats-modal.stats-modal-rich .kku-modal-content.kku-modal-maximized {
    width: min(100vw - 0.75rem, 100%) !important;
    max-width: min(100vw - 0.75rem, 100%) !important;
    min-width: min(320px, 100%) !important;
    height: min(100dvh - 0.75rem, 100%) !important;
    max-height: min(100dvh - 0.75rem, 100%) !important;
}

.kku-modal-close {
    background: var(--kku-modal-header-action-bg, rgba(255, 255, 255, 0.14));
    border: 1px solid var(--kku-modal-header-action-border, rgba(255, 255, 255, 0.28));
    font-size: 1.25rem;
    color: #fff;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
    line-height: 1;
}

    .kku-modal-close:hover {
        background: var(--kku-modal-header-action-bg-hover, rgba(255, 255, 255, 0.26));
        border-color: rgba(255, 255, 255, 0.45);
        color: #fff;
        transform: scale(1.04);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

/* Modal Body */
.kku-modal-body {
    margin-bottom: 0;
    padding: 1.5rem;
    background: white;
    max-height: calc(85vh - 140px);
    overflow-y: auto;
    color: #4a5568;
    line-height: 1.6;
}

/* Liste/ağaç modalları: gövde padding'i kaldır; kalan yüksekliği flex ile doldur (65vh taşması son kartı kesmesin) */
.kku-modal-body:has(.fakulte-list-container),
.kku-modal-body:has(.bolum-tree-container),
.kku-modal-body:has(.program-tree-container) {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
}

.kku-modal-body:has(.fakulte-list-container) > .stats-source-banner,
.kku-modal-body:has(.bolum-tree-container) > .stats-source-banner,
.kku-modal-body:has(.program-tree-container) > .stats-source-banner {
    flex-shrink: 0;
    margin: 0;
}

/* Modal Footer */
.kku-modal-footer {
    text-align: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(0, 51, 102, 0.08);
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    min-height: 60px;
    flex-shrink: 0;
}

    .kku-modal-footer.left {
        justify-content: flex-start;
    }

    .kku-modal-footer.right {
        justify-content: flex-end;
    }

    .kku-modal-footer.space-between {
        justify-content: space-between;
    }

/* Modal Butonları */
.kku-modal-btn {
    padding: 0.625rem 1.75rem;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

    .kku-modal-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: left 0.5s ease;
    }

    .kku-modal-btn:hover::before {
        left: 100%;
    }

    .kku-modal-btn.primary {
        background: linear-gradient(135deg, #991b1b 0%, #b91c1c 50%, #dc2626 100%);
        color: white;
        box-shadow: 0 3px 12px rgba(220, 38, 38, 0.25);
    }

        .kku-modal-btn.primary:hover {
            transform: translateY(-3px) scale(1.05);
            box-shadow: 0 8px 25px rgba(0, 51, 102, 0.4);
        }

    .kku-modal-btn.secondary {
        background: #e2e8f0;
        color: #4a5568;
    }

        .kku-modal-btn.secondary:hover {
            background: #cbd5e0;
            transform: translateY(-2px);
        }

    .kku-modal-btn.success {
        background: linear-gradient(135deg, #48bb78, #38a169);
        color: white;
    }

        .kku-modal-btn.success:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(72, 187, 120, 0.4);
        }

    .kku-modal-btn.danger {
        background: linear-gradient(135deg, #f56565, #e53e3e);
        color: white;
    }

        .kku-modal-btn.danger:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(245, 101, 101, 0.4);
        }

    .kku-modal-btn.warning {
        background: linear-gradient(135deg, #ed8936, #dd6b20);
        color: white;
    }

        .kku-modal-btn.warning:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(237, 137, 54, 0.4);
        }

    .kku-modal-btn.info {
        background: linear-gradient(135deg, #4299e1, #3182ce);
        color: white;
    }

        .kku-modal-btn.info:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 30px rgba(66, 153, 225, 0.4);
        }

/* Modal İçerik Öğeleri */
.kku-modal-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid rgba(0, 51, 102, 0.08);
    transition: all 0.2s ease;
    border-radius: 0;
    margin: 0.125rem 0;
}

    .kku-modal-detail:hover {
        background: linear-gradient(90deg, rgba(0, 51, 102, 0.03), rgba(0, 51, 102, 0.05));
        transform: translateX(4px);
    }

    .kku-modal-detail:last-child {
        border-bottom: none;
    }

.kku-modal-detail-label {
    font-weight: 500;
    color: #4a5568;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .kku-modal-detail-label::before {
        content: '▸';
        color: #991b1b;
        font-size: 0.7rem;
        opacity: 0.5;
    }

.kku-modal-detail-value {
    font-weight: 700;
    color: #991b1b;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #991b1b, #b91c1c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Vurgulu özet şeridi (turuncu/kırmızı banner üzerinde okunaklı metin) */
.kku-modal-detail.kku-modal-detail--banner {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-bottom: none;
    color: #fff;
}
.kku-modal-detail.kku-modal-detail--banner:hover {
    transform: none;
}
.kku-modal-detail.kku-modal-detail--banner-orange:hover {
    background: linear-gradient(135deg, #EA580C 0%, #c2410c 100%);
}
.kku-modal-detail.kku-modal-detail--banner-red:hover {
    background: linear-gradient(135deg, #DC2626 0%, #991b1b 100%);
}
.kku-modal-detail.kku-modal-detail--banner-orange {
    background: linear-gradient(135deg, #EA580C 0%, #c2410c 100%);
}
.kku-modal-detail.kku-modal-detail--banner-red {
    background: linear-gradient(135deg, #DC2626 0%, #991b1b 100%);
}
.kku-modal-detail.kku-modal-detail--banner .kku-modal-detail-label {
    color: #fff !important;
    font-size: 1.125rem;
    font-weight: 600;
}
.kku-modal-detail.kku-modal-detail--banner .kku-modal-detail-label::before {
    display: none;
}
.kku-modal-detail.kku-modal-detail--banner .kku-modal-detail-value,
.kku-modal-detail-value.kku-modal-detail-value--on-banner {
    color: #fff !important;
    font-size: 1.5rem;
    font-weight: 700;
    background: none !important;
    -webkit-background-clip: border-box !important;
    -webkit-text-fill-color: #fff !important;
    background-clip: border-box !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
}

/* Modal Liste */
.kku-modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.kku-modal-list-item {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

    .kku-modal-list-item:last-child {
        border-bottom: none;
    }

/* Animasyonlar */
@keyframes kkuModalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes kkuModalPopIn {
    0% {
        opacity: 0;
        transform: scale(0.7) translateY(-20px);
    }

    50% {
        transform: scale(1.05) translateY(0);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes kkuModalPopOut {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
}

@keyframes kkuModalSlideInUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading State */
.kku-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 1rem;
}

.kku-modal-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: kkuModalSpin 1s linear infinite;
}

@keyframes kkuModalSpin {
    to {
        transform: rotate(360deg);
    }
}

.kku-modal-loading-text {
    color: #718096;
    font-size: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .kku-modal {
        padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px));
        align-items: flex-start;
        justify-content: center;
    }

    .kku-modal.show {
        padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px));
    }

    .kku-modal-content,
    .kku-modal-content.small,
    .kku-modal-content.medium,
    .kku-modal-content.large,
    .kku-modal-content.xlarge,
    [class$="-modal-content"] {
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        min-width: 0 !important;
        max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        margin: 0 auto !important;
        border-radius: 10px;
    }

    .kku-modal-content.kku-modal-positioned,
    [class$="-modal-content"].kku-modal-positioned {
        left: 12px !important;
        right: 12px !important;
        width: calc(100vw - 24px) !important;
        max-width: calc(100vw - 24px) !important;
        min-width: 0 !important;
    }

    .kku-modal-title {
        font-size: 1.05rem;
        line-height: 1.3;
        word-break: break-word;
    }

    .kku-modal-header {
        padding: 0.75rem 0.85rem;
        min-height: 48px;
    }

    .kku-modal-body {
        padding: 1rem 0.85rem;
        max-height: calc(100dvh - 11rem);
    }

    .kku-modal-body:has(.fakulte-list-container),
    .kku-modal-body:has(.bolum-tree-container),
    .kku-modal-body:has(.program-tree-container) {
        padding: 0;
    }

    .kku-modal-footer {
        padding: 0.75rem 0.85rem;
        flex-direction: column;
        gap: 0.65rem;
    }

    .kku-modal-btn {
        width: 100%;
        justify-content: center;
    }

    .kku-modal-close,
    .kku-modal-expand {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .fakulte-list-header {
        padding: 0.85rem 1rem;
    }

    .fakulte-list-grid {
        padding: 0.5rem 0.75rem;
        max-height: none;
    }

    .fakulte-list-card-title {
        word-break: break-word;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 480px) {
    .kku-modal-content,
    .kku-modal-content.small,
    .kku-modal-content.medium,
    .kku-modal-content.large {
        border-radius: 8px;
        min-height: 0;
    }

    .kku-modal-title {
        font-size: 0.95rem;
    }

    .kku-modal-header {
        padding: 0.65rem 0.75rem;
    }

    .kku-modal-body {
        padding: 0.85rem 0.75rem;
    }

    .fakulte-list-header {
        padding: 0.75rem 0.85rem;
    }

    .fakulte-list-grid {
        padding: 0.45rem 0.65rem;
    }
}

/* Scrollbar Styling */
.kku-modal-content::-webkit-scrollbar,
.kku-modal-body::-webkit-scrollbar {
    width: 8px;
}

.kku-modal-content::-webkit-scrollbar-track,
.kku-modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.kku-modal-content::-webkit-scrollbar-thumb,
.kku-modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #991b1b, #b91c1c);
    border-radius: 4px;
}

    .kku-modal-content::-webkit-scrollbar-thumb:hover,
    .kku-modal-body::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(135deg, #b91c1c, #dc2626);
    }

/* Fakülte Listesi Stilleri */
.fakulte-list-container {
    padding: 0;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.fakulte-list-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: #ffffff;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.fakulte-list-count {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.3px;
}

    .fakulte-list-count::before {
        content: '';
        width: 4px;
        height: 20px;
        background: #ffffff;
        border-radius: 2px;
    }

.fakulte-list-loading,
.fakulte-list-empty,
.fakulte-list-error {
    padding: 3rem 2rem;
    text-align: center;
    color: #6b7280;
}

    .fakulte-list-loading .loading-spinner {
        width: 40px;
        height: 40px;
        border: 4px solid #e5e7eb;
        border-top-color: #dc2626;
        border-radius: 50%;
        animation: spin 1s linear infinite;
        margin: 0 auto 1rem;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.fakulte-list-loading p,
.fakulte-list-empty p,
.fakulte-list-error p {
    margin: 0;
    font-size: 0.95rem;
}

.fakulte-list-empty i,
.fakulte-list-error i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #d1d5db;
}

.fakulte-list-error i {
    color: #ef4444;
}

.fakulte-list-grid {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem 1rem 3.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: #f9fafb;
    scroll-padding-bottom: 3.25rem;
}

.fakulte-list-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.625rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
    box-shadow: none;
    position: relative;
}

    .fakulte-list-card:focus {
        outline: 2px solid #dc2626;
        outline-offset: 1px;
    }

    .fakulte-list-card:focus:not(:focus-visible) {
        outline: none;
    }

    .fakulte-list-card:focus-visible {
        outline: 2px solid #dc2626;
        outline-offset: 1px;
    }

    .fakulte-list-card:hover {
        border-color: #d1d5db;
        background: #fafafa;
    }

.fakulte-list-card-icon {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid #fecaca;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b91c1c;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.fakulte-list-card:hover .fakulte-list-card-icon {
    border-color: #f87171;
    color: #991b1b;
}

.fakulte-list-card-content {
    flex: 1;
    min-width: 0;
}

.bk-list-compare-btn {
    flex-shrink: 0;
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 1px solid rgba(200, 16, 46, 0.35);
    background: rgba(200, 16, 46, 0.08);
    color: #e11d48;
    border-radius: 0.55rem;
    padding: 0.4rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    z-index: 2;
}
.bk-list-compare-btn:hover {
    background: linear-gradient(135deg, #c8102e, #e11d48);
    border-color: transparent;
    color: #fff;
}
.bk-list-compare-btn.is-on {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.45);
    color: #34d399;
}
.bk-list-compare-btn--icon {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 0.5rem;
}
.bolum-tree-fakulte-header .bk-list-compare-btn,
.bolum-tree-item .bk-list-compare-btn,
.program-tree-bolum-header .bk-list-compare-btn,
.program-tree-fakulte-header .bk-list-compare-btn,
.program-tree-item .bk-list-compare-btn {
    margin-left: 0.35rem;
}

.bolum-tree-fakulte-header .bk-list-compare-btn,
.program-tree-bolum-header .bk-list-compare-btn,
.program-tree-fakulte-header .bk-list-compare-btn {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}
.bolum-tree-fakulte-header .bk-list-compare-btn:hover,
.program-tree-bolum-header .bk-list-compare-btn:hover,
.program-tree-fakulte-header .bk-list-compare-btn:hover {
    background: rgba(255, 255, 255, 0.32);
    color: #fff;
}
.bolum-tree-fakulte-header .bk-list-compare-btn.is-on,
.program-tree-bolum-header .bk-list-compare-btn.is-on,
.program-tree-fakulte-header .bk-list-compare-btn.is-on {
    background: rgba(16, 185, 129, 0.35);
    border-color: rgba(110, 231, 183, 0.7);
    color: #ecfdf5;
}

html[data-color-mode="dark"] .bk-list-compare-btn {
    background: rgba(200, 16, 46, 0.18);
    border-color: rgba(248, 113, 113, 0.4);
    color: #fda4af;
}
html[data-color-mode="dark"] .bk-list-compare-btn:hover {
    color: #fff;
}
html[data-color-mode="dark"] .bk-list-compare-btn.is-on {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(52, 211, 153, 0.45);
    color: #6ee7b7;
}

.fakulte-list-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827 !important;
    margin: 0 0 0.2rem 0;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: none;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 0;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fakulte-list-card:hover .fakulte-list-card-title {
    color: #991b1b !important;
}

.fakulte-list-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.75rem;
    margin: 0;
}

.fakulte-list-card-kod {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

    .fakulte-list-card-kod i {
        color: #9ca3af;
        font-size: 0.7rem;
    }

.fakulte-list-card-stats {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.fakulte-stat-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-weight: 500;
}

.fakulte-list-card:hover .fakulte-stat-item {
    color: #4b5563;
}

.fakulte-stat-item i {
    color: #9ca3af;
    font-size: 0.7rem;
}

.fakulte-list-card:hover .fakulte-stat-item i {
    color: #6b7280;
}

/* Eski şablonlarda kalan ok sütunu — artık kullanılmıyor; yine de gizli tutulur */
.fakulte-list-card-arrow {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .fakulte-list-grid {
        padding: 0.5rem 0.65rem;
        gap: 0.4rem;
    }

    .fakulte-list-card {
        padding: 0.5rem 0.65rem;
        gap: 0.5rem;
    }

    .fakulte-list-card-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .fakulte-list-card-title {
        font-size: 0.82rem;
        white-space: normal;
        display: -webkit-box !important;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .fakulte-list-card-stats {
        gap: 0.4rem;
    }

    .fakulte-stat-item {
        font-size: 0.7rem;
    }
}

/* Bölüm Tree Stilleri */
.bolum-tree-container {
    padding: 0;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.bolum-tree-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem 0.75rem 3.25rem;
    background: #f8fafc;
    scroll-padding-bottom: 3.25rem;
}

.bolum-tree-fakulte {
    background: #ffffff;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    border: 2px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.3s ease;
}

.bolum-tree-bolumler {
    display: none;
    padding: 0.4rem 0.5rem 0.45rem;
}

.bolum-tree-fakulte.expanded .bolum-tree-bolumler {
    display: block;
}

/* Personel modal: üst birim altında iç içe ağaç */
.personel-birim-children {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
}

.personel-birim-node--nested {
    margin-bottom: 0.4rem;
    border-width: 1px;
}

.personel-birim-node--depth-1 {
    margin-left: 0.65rem;
}

.personel-birim-node--depth-2 {
    margin-left: 1.1rem;
}

.personel-birim-node--depth-3,
.personel-birim-node--depth-4 {
    margin-left: 1.45rem;
}

.personel-birim-node--nested > .bolum-tree-fakulte-header {
    padding: 0.85rem 1.1rem;
    background: linear-gradient(135deg, #7f1d1d 0%, #b91c1c 100%);
}

.personel-birim-node--depth-2 > .bolum-tree-fakulte-header,
.personel-birim-node--depth-3 > .bolum-tree-fakulte-header,
.personel-birim-node--depth-4 > .bolum-tree-fakulte-header {
    background: linear-gradient(135deg, #991b1b 0%, #dc2626 55%, #1e3a8a 160%);
}

.personel-birim-staff {
    min-height: 0;
}

.personel-birim-staff-hint {
    margin: 0.4rem 0.15rem 0.55rem !important;
    padding: 0.7rem 0.9rem !important;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155 !important;
    font-size: 0.9rem !important;
    line-height: 1.4;
}

.personel-birim-staff-hint--leaf {
    display: none;
}

#stats-modal .fakulte-list-loading--inline {
    padding: 0.85rem 0.5rem;
    background: #f8fafc;
    border-radius: 8px;
    margin: 0.35rem 0;
}

#stats-modal .fakulte-list-loading--inline .loading-text {
    color: #475569;
    font-size: 0.9rem;
}

/* Arama sonuçları birim ağacının dışında; expanded olmadan da görünür olmalı */
#idari-personel-search-results .bolum-tree-bolumler,
#akademik-personel-search-results .bolum-tree-bolumler,
#stat-modal-search-results .bolum-tree-bolumler,
#stat-modal-search-results .stat-modal-search-list {
    display: flex;
    flex-direction: column;
}

.bolum-tree-fakulte.expanded > .bolum-tree-fakulte-header > .bolum-tree-chevron {
    transform: rotate(180deg);
}

.bolum-tree-fakulte-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
}

    .bolum-tree-fakulte-header:hover {
        background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    }

    .bolum-tree-fakulte-header i:first-child {
        font-size: 1.5rem;
    }

.bolum-tree-fakulte-name {
    flex-grow: 1;
    font-size: 1.1rem;
}

.bolum-tree-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
}

.bolum-tree-chevron {
    transition: transform 0.3s ease;
    font-size: 0.875rem;
}

.bolum-tree-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

    .bolum-tree-item:hover {
        transform: translateX(2px);
        box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
        border-color: #dc2626;
        background: #fef2f2;
    }

.bolum-tree-item.is-keyboard-active,
.bolum-tree-item.is-keyboard-active:hover {
    transform: translateX(4px);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.55), 0 4px 14px rgba(220, 38, 38, 0.18);
    border-color: #dc2626;
    background: #fef2f2;
    outline: none;
}

.bolum-tree-item-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.25rem;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.bolum-tree-item-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.bolum-tree-item-icon-fallback {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bolum-tree-item-content {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.bolum-tree-item-title {
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.25;
    color: #1f2937;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    min-width: 0;
}

.bolum-tree-item-name {
    font-weight: 700;
    color: #1f2937;
    min-width: 0;
    word-break: break-word;
}

.personel-unvan-badge {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    max-width: 100%;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, #003366 0%, #0066cc 100%);
    padding: 0.22rem 0.45rem;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 51, 102, 0.22);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bolum-tree-item-kod {
    font-size: 0.75rem;
    line-height: 1.3;
    color: #6b7280;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.bolum-tree-item-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 0.05rem;
}

.bolum-stat-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
    max-width: 100%;
    font-size: 0.72rem;
    color: #64748b;
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bolum-tree-item-arrow {
    color: #9ca3af;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: color 0.2s ease, transform 0.2s ease;
}

.modal-list-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 0.3rem;
    flex-shrink: 0;
    max-width: 42%;
    margin-left: auto;
}

.modal-list-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.2;
    border: 1px solid transparent;
    max-width: 100%;
    white-space: nowrap;
}

.modal-list-badge i {
    font-size: 0.58rem;
}

.modal-list-badge--tur {
    background: rgba(13, 76, 139, 0.12);
    color: #0d4c8b;
    border-color: rgba(13, 76, 139, 0.22);
}

.modal-list-badge--year {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
    border-color: rgba(100, 116, 139, 0.22);
}

.modal-list-badge--atif {
    background: rgba(234, 88, 12, 0.12);
    color: #c2410c;
    border-color: rgba(234, 88, 12, 0.22);
}

.modal-list-badge--info {
    background: rgba(107, 114, 128, 0.1);
    color: #4b5563;
    border-color: rgba(107, 114, 128, 0.18);
}

.stat-modal-search-item {
    align-items: flex-start;
}

.stat-modal-search-item .modal-list-badges {
    padding-top: 0.15rem;
}

.bolum-tree-item:hover .bolum-tree-item-arrow {
    color: #dc2626;
    transform: translateX(3px);
}

/* Program Tree Stilleri */
.program-tree-container {
    padding: 0;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.program-tree-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1rem 3.25rem;
    background: #f8fafc;
    scroll-padding-bottom: 3.25rem;
}

.program-tree-fakulte {
    background: #ffffff;
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 2px solid #e5e7eb;
    overflow: hidden;
}

    .program-tree-fakulte.expanded .program-tree-content {
        display: block;
    }

    .program-tree-fakulte.expanded > .program-tree-fakulte-header > .program-tree-chevron {
        transform: rotate(180deg);
    }

.program-tree-fakulte-header {
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #991b1b 0%, #dc2626 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 700;
}

    .program-tree-fakulte-header:hover {
        background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    }

    .program-tree-fakulte-header i:first-child {
        font-size: 1.5rem;
    }

.program-tree-fakulte-name {
    flex-grow: 1;
    font-size: 1.1rem;
}

.program-tree-content {
    display: none;
    padding: 0.75rem;
}

.program-tree-bolum {
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

    .program-tree-bolum.expanded .program-tree-programlar {
        display: block;
    }

    .program-tree-bolum.expanded > .program-tree-bolum-header > .program-tree-chevron {
        transform: rotate(180deg);
    }

.program-tree-bolum-header {
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

    .program-tree-bolum-header:hover {
        background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    }

.program-tree-bolum-name {
    flex-grow: 1;
    font-size: 0.95rem;
}

.program-tree-programlar {
    display: none;
    padding: 0.5rem;
}

/* Anabilim modalı: iç içe program satırları her zaman görünsün (expanded) */
.bolum-tree-bolumler .program-tree-bolum.expanded > .program-tree-programlar,
.bolum-tree-container--enstitu .bolum-tree-abd-with-programs.expanded > .program-tree-programlar {
    display: block;
}

.program-ogrenim-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.15rem 0.55rem;
    border-radius: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    vertical-align: middle;
    white-space: nowrap;
}

.program-ogrenim-badge--yl {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.program-ogrenim-badge--dr {
    background: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
}

.program-tree-item-abd {
    margin: 0.15rem 0 0;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 500;
}

.program-tree-container--flat .program-tree-programlar--flat {
    display: block;
    padding: 0.75rem 0.5rem 1rem;
}

.program-tree-container--flat .program-tree-item {
    margin-bottom: 0.65rem;
}

.bolum-tree-container--enstitu .bolum-tree-abd-with-programs > .program-tree-bolum-header {
    background: linear-gradient(135deg, #0f766e 0%, #0d9488 100%);
}

.bolum-tree-container--enstitu .bolum-tree-abd-with-programs > .program-tree-bolum-header:hover {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
}

.program-tree-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.875rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .program-tree-item:hover {
        transform: translateX(5px);
        box-shadow: 0 4px 12px rgba(220, 38, 38, 0.15);
        border-color: #dc2626;
        background: #fef2f2;
    }

.program-tree-item-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1rem;
    flex-shrink: 0;
}

.program-tree-item-content {
    flex-grow: 1;
    min-width: 0;
}

.program-tree-item-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 0.25rem 0;
}

.program-tree-item-kod {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0 0 0.375rem 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.program-stat-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: #4b5563;
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-weight: 600;
}

.program-tree-item-arrow {
    color: #9ca3af;
    font-size: 0.875rem;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.program-tree-item:hover .program-tree-item-arrow {
    color: #dc2626;
    transform: translateX(3px);
}

.program-tree-direct {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    margin-top: 0.75rem;
    padding: 0.75rem;
}

.program-tree-direct-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

    .program-tree-direct-header i {
        color: #f59e0b;
    }

/* Responsive */
@media (max-width: 768px) {
    .bolum-tree-fakulte-header,
    .program-tree-fakulte-header {
        padding: 1rem;
        font-size: 0.9rem;
    }

    .bolum-tree-item,
    .program-tree-item {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    /* Personel / bölüm kartlarında fotoğraf kutusu küçülmesin */
    .bolum-tree-item-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .program-tree-item-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .stat-modal-search-item .modal-list-badges {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        max-width: 52%;
        gap: 0.25rem;
    }
}

/* Arama Input + Buton Grubu */
.modal-search-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
    max-width: 520px;
}

/* Arama Input Stilleri */
.modal-search-container {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.modal-search-input {
    width: 100%;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

    .modal-search-input::placeholder {
        color: rgba(255, 255, 255, 0.7);
    }

    .modal-search-input:focus {
        outline: none;
        border-color: rgba(255, 255, 255, 0.6);
        background: rgba(255, 255, 255, 0.25);
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    }

        .modal-search-input:focus + .modal-search-icon {
            color: rgba(255, 255, 255, 1);
        }

.modal-search-icon {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
    transition: color 0.3s ease;
}

.modal-search-clear {
    position: absolute;
    right: 2.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.25rem;
    display: none;
    transition: color 0.3s ease;
}

    .modal-search-clear:hover {
        color: rgba(255, 255, 255, 1);
    }

    .modal-search-clear.show {
        display: block;
    }

/* Modal içi Detaylı Ara butonu (ana sayfa arama butonu yanındaki ile aynı stil) */
.modal-search-secondary-btn {
    flex-shrink: 0;
    height: 42px;
    min-width: 120px;
    padding: 0 1rem;
    background: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    color: #dc2626;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.modal-search-secondary-btn:hover {
    background: #fef2f2;
    border-color: #ffffff;
    color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-search-secondary-btn:active {
    transform: translateY(0);
}

/* Akademik personel modalı: "Detaylı Ara" artık kullanılmıyor; eski önbellekli JS için gizle */
#akademik-personel-detayli-ara-btn {
    display: none !important;
}

@media (max-width: 768px) {
    .fakulte-list-header {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-search-actions {
        max-width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .modal-search-container {
        max-width: 100%;
    }

    .modal-search-secondary-btn {
        width: 100%;
        min-width: 0;
    }
}
