/* Ä°statistikler CSS */
.stats-container {
    padding: 2rem 0;
    background: #ffffff;
    /* min-height: 100vh; */
    position: relative;
    overflow: hidden;
    margin-bottom: 25px;
    /* Birim analiz sayfasıyla aynı yuvarlatılmış çerçeve (ana sayfa dahil) */
    border-radius: 10px;
}

.stats-container > #stats-container {
    position: relative;
    z-index: 1;
}

#stats-container {
    border-radius: 10px;
}

/* Anlık Güncelleme Bildirimi - Sağ Üst Köşe */
.stats-update-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4), 0 0 20px rgba(220, 38, 38, 0.2);
    display: none;
    align-items: center;
    gap: 10px;
    z-index: 10000;
    font-size: 14px;
    font-weight: 600;
    animation: slideInRight 0.3s ease-out, pulse 2s ease-in-out infinite;
    backdrop-filter: blur(10px);
}

.stats-update-notification.show {
    display: flex;
}

.stats-update-notification i {
    animation: spin 1s linear infinite;
}

.stats-update-notification .update-text {
    white-space: nowrap;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

    .stats-container::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="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
        opacity: 0.3;
        animation: float 20s ease-in-out infinite;
    }

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

.stats-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
}

.stats-title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 1rem;
    animation: slideInDown 1s ease-out;
}

.stats-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    font-weight: 300;
    animation: slideInUp 1s ease-out 0.3s both;
}

/* Loading - Nötr animasyon (hafif kırmızı vurgu, detay loading-animation.css) */
.stats-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 260px;
    padding: 2rem 1.5rem;
    background: #fafbfc;
    border: 1px solid #e8eaed;
    border-radius: 14px;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.stats-loading::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 60% 50% at 50% 30%, rgba(0, 0, 0, 0.02) 0%, transparent 65%);
    pointer-events: none;
}

.stats-loading::after {
    display: none;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    position: relative;
    margin-bottom: 1rem;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid #e2e8f0;
    border-top-color: rgba(220, 53, 69, 0.7);
    animation: spin 0.85s linear infinite;
}

.loading-spinner::after {
    display: none;
}

.loading-spinner .inner-spinner,
.loading-spinner .center-dot {
    display: none;
}

.loading-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #64748b;
    text-align: center;
    margin: 0;
}

.loading-progress {
    width: 120px;
    height: 3px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 1rem;
}

.loading-progress::before {
    content: '';
    display: block;
    height: 100%;
    width: 32%;
    background: rgba(220, 53, 69, 0.5);
    border-radius: 2px;
    animation: progressMove 1.2s ease-in-out infinite;
}

@keyframes progressMove {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(200%); }
}

/* Loading dots - gri, ortadaki hafif kırmızı */
.loading-dots {
    display: flex;
    gap: 6px;
    margin-top: 0.75rem;
}

.loading-dots .dot {
    width: 6px;
    height: 6px;
    background: #cbd5e1;
    border-radius: 50%;
    animation: dotBounce 1.2s ease-in-out infinite;
}

.loading-dots .dot:nth-child(2) {
    background: rgba(220, 53, 69, 0.35);
}

.loading-dots .dot:nth-child(1) { animation-delay: 0s; }
.loading-dots .dot:nth-child(2) { animation-delay: 0.15s; }
.loading-dots .dot:nth-child(3) { animation-delay: 0.3s; }

/* Loading states için ek animasyonlar */
.stats-loading.loading-complete {
    animation: loadingComplete 0.8s ease-out forwards;
}

@keyframes loadingComplete {
    0% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.05);
        opacity: 0.8;
    }
    100% { 
        transform: scale(0.95);
        opacity: 0;
    }
}

/* Responsive loading - minimal */
@media (max-width: 768px) {
    .stats-loading {
        min-height: 220px;
        padding: 1.5rem 1rem;
    }
    .loading-spinner {
        width: 40px;
        height: 40px;
    }
    .loading-text {
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .stats-loading {
        min-height: 180px;
    }
    .loading-spinner {
        width: 36px;
        height: 36px;
    }
    .loading-text {
        font-size: 0.8125rem;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.1);
        opacity: 0.7;
    }
}

@keyframes centerPulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0.8;
    }
}

@keyframes textGradient {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes textPulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.05);
        opacity: 0.9;
    }
}

@keyframes progressMove {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(200%); }
}

@keyframes dotBounce {
    0%, 80%, 100% { 
        transform: scale(0);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
    border-radius: 10px;
}

.stat-card {
    border-radius: 25px;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition:
        transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.42s ease,
        filter 0.35s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: none;
    color: white;
    background: linear-gradient(135deg, #667eea, #764ba2);
    min-height: 180px;
    height: auto;
}

    /* Arka plan simgesi - sağ alt köşede büyük ve soluk */
    .stat-card::before {
        content: '';
        position: absolute;
        bottom: -30px;
        right: -30px;
        font-size: 140px;
        opacity: 0.08;
        color: white;
        z-index: 1;
        transform: rotate(-20deg);
        transform-origin: center;
        transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    }

    /* Hover: üstten yumuşak ışık lekesi (radial) — alt çizgi yok */
    .stat-card::after {
        content: "";
        position: absolute;
        inset: 0;
        border-radius: inherit;
        background: radial-gradient(95% 70% at 50% -5%, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.08) 38%, transparent 62%);
        opacity: 0;
        transition: opacity 0.45s ease;
        pointer-events: none;
        z-index: 2;
    }

    .stat-card:hover::after {
        opacity: 1;
    }

    .stat-card.loading::after {
        display: none;
    }

    /* Her kart iÃ§in farklÄ± arka plan nesneleri - iÃ§eriÄŸe uygun */
    /* TÃ¼m Ã¶zel simgeler kaldÄ±rÄ±ldÄ± - genel stil kullanÄ±lÄ±yor */

    /* Her kart iÃ§in farklÄ± renkler */
    .stat-card[data-stat-index="0"] {
        background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    }

    .stat-card[data-stat-index="1"] {
        background: linear-gradient(135deg, #1D4ED8, #1E40AF);
    }

    .stat-card[data-stat-index="2"] {
        background: linear-gradient(135deg, #2563EB, #1E40AF);
    }

    .stat-card[data-stat-index="3"] {
        background: linear-gradient(135deg, #7C3AED, #5B21B6);
    }

    .stat-card[data-stat-index="4"] {
        background: linear-gradient(135deg, #059669, #047857);
    }

    /* İdari Personel - teal */
    .stat-card[data-stat-index="5"] {
        background: linear-gradient(135deg, #0D9488, #0F766E);
    }

    .stat-card[data-stat-index="6"] {
        background: linear-gradient(135deg, #DC2626, #B91C1C);
    }

    .stat-card[data-stat-index="7"] {
        background: linear-gradient(135deg, #EA580C, #C2410C);
    }

    .stat-card[data-stat-index="8"] {
        background: linear-gradient(135deg, #059669, #047857);
    }

    .stat-card[data-stat-index="9"] {
        background: linear-gradient(135deg, #7C2D12, #5C1910);
    }

    .stat-card[data-stat-index="10"] {
        background: linear-gradient(135deg, #92400E, #78350F);
    }

    .stat-card[data-stat-index="11"] {
        background: linear-gradient(135deg, #78350F, #5C1910);
    }

    .stat-card[data-stat-index="12"] {
        background: linear-gradient(135deg, #BE185D, #9D174D);
    }

    .stat-card[data-stat-index="13"] {
        background: linear-gradient(135deg, #F59E0B, #D97706);
    }

    .stat-card[data-stat-index="14"] {
        background: linear-gradient(135deg, #10B981, #059669);
    }

    .stat-card[data-stat-index="15"] {
        background: linear-gradient(135deg, #0EA5E9, #0284C7);
    }

    .stat-card[data-stat-index="16"] {
        background: linear-gradient(135deg, #8B5CF6, #7C3AED);
    }

    .stat-card[data-stat-index="17"] {
        background: linear-gradient(135deg, #F59E0B, #D97706);
    }

    .stat-card[data-stat-index="18"] {
        background: linear-gradient(135deg, #EC4899, #DB2777);
    }

    .stat-card[data-stat-index="19"] {
        background: linear-gradient(135deg, #06B6D4, #0891B2);
    }

    .stat-card[data-stat-index="20"] {
        background: linear-gradient(135deg, #84CC16, #65A30D);
    }

    .stat-card[data-stat-index="21"] {
        background: linear-gradient(135deg, #F97316, #EA580C);
    }

    /* Simge container'ı - sol üstteki küçük simge */
    .stat-card .stat-icon {
        position: absolute !important;
        top: 10px;
        left: 10px;
        z-index: 3;
        width: 90px;
        height: 90px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.25);
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid rgba(255, 255, 255, 0.4);
        transition:
            transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
            background 0.35s ease,
            border-color 0.35s ease,
            box-shadow 0.35s ease;
    }

        .stat-card .stat-icon i {
            font-size: 50px;
            color: white;
            position: relative;
            z-index: 1;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
            transition: transform 0.25s ease, filter 0.25s ease;
        }

    /* İçerik - ortada; taşmayı önlemek için sınırlı alan ve satır kaydırma */
    .stat-card .stat-content {
        position: absolute;
        z-index: 3;
        text-align: center;
        padding: 10px 1rem 1rem;
        left: 110px;
        right: 1rem;
        top: 16px;
        bottom: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        min-width: 0;
    }

    .stat-card .stat-number {
        font-size: 2.8rem;
        font-weight: 700;
        margin: 0 0 0.5rem;
        color: white;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 1px rgba(0, 0, 0, 0.9);
        flex-shrink: 0;
    }

    .stat-card .stat-number__inner,
    .stat-card .stat-db-count__inner {
        font-variant-numeric: tabular-nums;
        display: inline-block;
        min-width: 0.6em;
    }

    .stat-card .stat-number__inner.kku-stat-count-active,
    .stat-card .stat-db-count__inner.kku-stat-count-active {
        transition: none;
    }

    /* Developer mod: DB kayıt sayısı (ES ile karşılaştırma) */
    .stat-card .stat-db-count {
        font-size: 0.8rem;
        margin: 0 0 0.35rem;
        color: rgba(255, 255, 255, 0.95);
        font-weight: 500;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 1px rgba(0, 0, 0, 0.8);
    }

    .stat-card .stat-label {
        font-size: 1.1rem;
        margin: 0 0 0.5rem;
        color: white;
        font-weight: 600;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 1px rgba(0, 0, 0, 0.9);
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        line-height: 1.3;
        max-width: 100%;
        overflow: hidden;
    }

    .stat-card .stat-info {
        font-size: 0.85rem;
        color: rgba(255, 255, 255, 0.95);
        font-style: italic;
        line-height: 1.35;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 1px rgba(0, 0, 0, 0.9);
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        max-width: 100%;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-clamp: 2;
    }

/* Modal Styles - KKU Mavi Tema */
.stats-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 51, 102, 0.85);
    backdrop-filter: blur(12px);
    animation: fadeIn 0.3s ease-out;
}

    .stats-modal.show {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 2rem 1rem;
    }

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 8px;
    padding: 0;
    max-width: 550px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
    animation: slideInUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0, 51, 102, 0.35);
    border: none;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #003366 0%, #004080 50%, #0052a3 100%);
    color: white;
    margin-bottom: 0;
    border-bottom: none;
    position: relative;
    overflow: hidden;
    min-height: 60px;
}

.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;
}

.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;
}

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

.modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 1.25rem;
    color: white;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    border-radius: 0;
    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;
}

    .modal-close:hover {
        background: rgba(255, 255, 255, 0.25);
        border-color: rgba(255, 255, 255, 0.5);
        color: white;
        transform: rotate(90deg) scale(1.1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

.modal-body {
    margin-bottom: 0;
    padding: 1.5rem;
    background: white;
    max-height: calc(85vh - 140px);
    overflow-y: auto;
}

.stat-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;
}

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

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

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

.stat-detail-label::before {
    content: '▸';
    color: #003366;
    font-size: 0.7rem;
    opacity: 0.5;
}

.stat-detail-value {
    font-weight: 700;
    color: #003366;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #003366, #004080);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-footer {
    display: none;
}

    .modal-footer .btn {
        background: linear-gradient(135deg, #003366 0%, #004080 50%, #0052a3 100%);
        border: none;
        color: white;
        padding: 0.625rem 1.75rem;
        border-radius: 4px;
        font-weight: 600;
        font-size: 0.9rem;
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        box-shadow: 0 3px 12px rgba(0, 51, 102, 0.25);
        position: relative;
        overflow: hidden;
    }

    .modal-footer .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;
    }

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

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

    .modal-footer .btn:active {
        transform: translateY(-1px) scale(1.02);
    }

/* Responsive Design */
@media (max-width: 768px) {
    .stats-container {
        padding: 0.5rem 0 1rem;
        margin-bottom: 1rem;
        background: transparent;
        border-radius: 0;
        overflow: visible;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    #stats-container {
        border-radius: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    #stats-grid-container {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .stats-container::before {
        display: none;
    }

    .stats-title {
        font-size: 2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.65rem;
        padding: 0;
        margin: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        box-sizing: border-box;
    }

    .stat-card {
        border-radius: 12px;
        min-height: 118px;
        padding: 0.875rem 1rem;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
        display: flex;
        align-items: center;
        gap: 0.75rem;
        text-align: left;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .stat-card .stat-icon {
        position: static !important;
        top: auto;
        left: auto;
        width: 56px;
        height: 56px;
        flex-shrink: 0;
    }

    .stat-card .stat-icon i {
        font-size: 1.65rem;
    }

    .stat-card .stat-content {
        position: static;
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
        flex: 1;
        min-width: 0;
        padding: 0;
        text-align: left;
        align-items: flex-start;
        justify-content: center;
    }

    .stat-card .stat-number {
        font-size: 1.85rem;
        margin-bottom: 0.2rem;
    }

    .stat-card .stat-label {
        font-size: 0.82rem;
        line-height: 1.25;
        letter-spacing: 0.02em;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .modal-content {
        margin: 1rem;
        max-width: 95%;
    }

    .modal-header {
        padding: 0.875rem 1.25rem;
        min-height: 50px;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .modal-footer {
        padding: 0.875rem 1.25rem;
    }

    .modal-close {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .stats-title {
        font-size: 1.5rem;
    }

    .stats-grid {
        gap: 0.55rem;
    }

    .stat-card {
        min-height: 108px;
        padding: 0.75rem 0.875rem;
        border-radius: 10px;
    }

    .stat-card .stat-icon {
        width: 50px;
        height: 50px;
    }

    .stat-card .stat-icon i {
        font-size: 1.45rem;
    }

    .stat-card .stat-number {
        font-size: 1.65rem;
    }

    .stat-card .stat-label {
        font-size: 0.76rem;
    }

    .stat-card .stat-info {
        font-size: 0.75rem;
    }
}

/* Error State */
.stats-error {
    text-align: center;
    color: white;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.stats-error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.stats-error-text {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.stats-error-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .stats-error-btn:hover {
        background: rgba(255,255,255,0.3);
        border-color: rgba(255,255,255,0.5);
    }

/* Loading States */
.stat-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

    .stat-card.loading .stat-number {
        background: linear-gradient(90deg, #e2e8f0 25%, #cbd5e0 50%, #e2e8f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
    }

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Hover: elastik hafif kaldırma + derin gölge + üst ışık lekesi; ikon hafif yukarı */
.stat-card:hover {
    transform: translateY(-7px);
    box-shadow: 0 24px 48px -10px rgba(0, 0, 0, 0.28);
    filter: brightness(1.03);
}

    .stat-card:hover .stat-icon {
        transform: translateY(-5px) scale(1.05);
        background: rgba(255, 255, 255, 0.32);
        border-color: rgba(255, 255, 255, 0.55);
        box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
    }

    .stat-card:hover::before {
        opacity: 0.11;
        transform: rotate(-18deg) scale(1.04);
    }

@media (prefers-reduced-motion: reduce) {
    .stat-card,
    .stat-card::before,
    .stat-card::after,
    .stat-card .stat-icon {
        transition-duration: 0.01ms !important;
    }

    .stat-card:hover {
        transform: none;
        filter: none;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    }

    .stat-card:hover::after {
        opacity: 0.55;
    }

    .stat-card:hover .stat-icon {
        transform: none;
    }

    .stat-card:hover::before {
        transform: rotate(-20deg);
    }
}

/* Modal Animasyonları */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(60px) scale(0.95);
    }

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

/* Modal scrollbar styling */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

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

.modal-body::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #003366, #004080);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #004080, #0052a3);
}

/* İstatistik kartı — öğrenci sonrası modallar (Yayın, Editörlük, Proje …) */
#stats-modal.stats-modal-rich .kku-modal-content.medium {
    min-height: 0 !important;
    max-width: min(460px, 96vw) !important;
}

#stats-modal.stats-modal-rich .kku-modal-content.medium.kku-modal-maximized,
#stats-modal.stats-modal-rich .kku-modal-content.large.kku-modal-maximized,
#stats-modal.stats-modal-rich .kku-modal-content.xlarge.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;
}

#stats-modal.stats-modal-rich .kku-modal-content.kku-modal-maximized .kku-modal-body {
    max-height: none !important;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#stats-modal.stats-modal-rich .kku-modal-content.kku-modal-maximized .stats-modal-tabs {
    flex: 1 1 auto;
    min-height: 0;
}

#stats-modal.stats-modal-rich .kku-modal-content.kku-modal-maximized .stats-modal-tab-pane.active {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

#stats-modal.stats-modal-rich .kku-modal-content.kku-modal-maximized .stats-rich-modal {
    min-height: 0;
}

#stats-modal.stats-modal-rich .kku-modal-body {
    padding: 1rem 1.25rem 1.25rem;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 28%);
}

.stats-rich-modal {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.stats-rich-hero {
    display: flex;
    align-items: stretch;
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.stats-rich-hero-icon {
    flex: 0 0 4.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, var(--stat-accent, #dc2626) 0%, color-mix(in srgb, var(--stat-accent, #dc2626) 75%, #000) 100%);
    color: #fff;
    font-size: 1.75rem;
}

.stats-rich-hero-text {
    flex: 1;
    padding: 0.9rem 1rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.stats-rich-hero-kicker {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
}

.stats-rich-hero-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
}

.stats-rich-hero-number {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--stat-accent, #dc2626);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.stats-rich-section-title {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.stats-rich-section-title i {
    color: #dc2626;
    opacity: 0.85;
}

.stats-rich-metrics {
    list-style: none;
    margin: 0;
    padding: 0;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    overflow: hidden;
}

.stats-rich-metric {
    display: grid;
    grid-template-columns: 2.25rem 1fr auto;
    gap: 0.5rem 0.75rem;
    align-items: center;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #f1f5f9;
}

.stats-rich-metric:last-child {
    border-bottom: none;
}

.stats-rich-metric:nth-child(even) {
    background: #fafbfc;
}

.stats-rich-metric--empty {
    grid-template-columns: 1fr;
    color: #64748b;
    font-size: 0.9rem;
    font-style: italic;
}

.stats-rich-metric--prose {
    display: block;
    grid-template-columns: none;
    padding: 0.75rem 0.9rem;
    background: #f8fafc;
}

.stats-rich-metric-prose {
    font-size: 0.8125rem;
    line-height: 1.5;
    color: #475569;
}

.stats-rich-metric-prose strong {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.stats-rich-metric-prose span {
    font-weight: 500;
    color: #334155;
}

.stats-rich-metric-ic {
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #fef2f2 0%, #fff 100%);
    border: 1px solid #fecaca;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dc2626;
    font-size: 0.85rem;
}

.stats-rich-metric-lbl {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

.stats-rich-metric-val {
    font-size: 0.95rem;
    font-weight: 800;
    color: #dc2626;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.stats-rich-foot {
    margin-top: 1rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: 0.8rem;
    color: #475569;
    line-height: 1.45;
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}

.stats-rich-foot i {
    color: #64748b;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.stats-rich-source {
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #334155;
}

.stats-rich-source-title {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.stats-rich-source-title i {
    color: #64748b;
}

.stats-rich-source-dl {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(5.5rem, auto) 1fr;
    gap: 0.35rem 0.75rem;
}

.stats-rich-source-dl dt {
    margin: 0;
    font-weight: 600;
    color: #475569;
    font-size: 0.75rem;
}

.stats-rich-source-dl dd {
    margin: 0;
    font-size: 0.78rem;
    color: #334155;
}

.stats-rich-source-jobs {
    font-family: ui-monospace, monospace;
    font-size: 0.72rem;
    word-break: break-word;
}

.stats-source-banner {
    margin-bottom: 0.85rem;
    padding: 0.65rem 0.9rem;
    border-radius: 10px;
    /* Daha yüksek kontrast: okunabilir metin + net çerçeve */
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    border: 1px solid #3b82f6;
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06), 0 4px 12px rgba(37, 99, 235, 0.12);
    font-size: 0.82rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.45;
    display: flex;
    gap: 0.55rem;
    align-items: flex-start;
}

.stats-source-banner i {
    flex-shrink: 0;
    margin-top: 0.08rem;
    font-size: 1rem;
    color: #1d4ed8;
}

@supports not (color: color-mix(in srgb, red, blue)) {
    .stats-rich-hero-icon {
        background: var(--stat-accent, #dc2626);
    }
}

/* İlk boyama: REST öncesi kart kabuğu (sayı alanı boş kalmaz) */
.stat-card--shell {
    pointer-events: none;
    opacity: 0.92;
}

/* Öğrenci detay modalı — grafik panelleri */
.stats-ogrenci-chart-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.stats-ogrenci-chart-panel {
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.stats-ogrenci-chart-panel--wide {
    margin-top: 30px;
}

.stats-ogrenci-chart-panel__title {
    margin: 0 0 15px;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-ogrenci-chart-panel__chart {
    width: 100%;
    height: 280px;
}

.stats-ogrenci-chart-panel__chart--map {
    height: 520px;
    border-radius: 0.65rem;
    overflow: hidden;
    border: 1px solid #dbe3ee;
    background: #ffffff;
}

.stats-ogrenci-chart-panel__legend {
    margin-top: 10px;
    display: flex;
    justify-content: space-around;
    font-size: 12px;
    color: #6b7280;
    flex-wrap: wrap;
    gap: 8px;
}

.stats-ogrenci-chart-panel__legend--grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    font-size: 11px;
}

.stats-ogrenci-chart-panel__map-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 10px;
}

.stats-ogrenci-chart-panel__map-foot {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.65rem 1.1rem;
    font-size: 12px;
    color: #475569;
}

.stats-ogrenci-map-legend {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: #334155;
}

.stats-ogrenci-map-legend__swatch {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(15, 23, 42, 0.12);
}

.stats-ogrenci-map-legend__swatch--erkek {
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
}

.stats-ogrenci-map-legend__swatch--kadin {
    background: linear-gradient(135deg, #be185d, #ec4899);
}

.stats-ogrenci-map-legend-hint {
    color: #64748b;
    font-weight: 500;
}

.stats-ogrenci-map-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    padding: 0.65rem 0.35rem 0.15rem;
}

.stats-ogrenci-map-summary__chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #1e293b;
    font-size: 0.8125rem;
    font-weight: 600;
}

.stats-ogrenci-map-summary__chip strong {
    font-weight: 700;
    color: #475569;
}

.stats-ogrenci-map-summary__chip--erkek {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.28);
    color: #1d4ed8;
}

.stats-ogrenci-map-summary__chip--erkek strong {
    color: #1e40af;
}

.stats-ogrenci-map-summary__chip--kadin {
    background: rgba(219, 39, 119, 0.1);
    border-color: rgba(219, 39, 119, 0.28);
    color: #be185d;
}

.stats-ogrenci-map-summary__chip--kadin strong {
    color: #9d174d;
}

@media (max-width: 768px) {
    .stats-ogrenci-chart-grid {
        grid-template-columns: 1fr;
    }
}

/* İstatistik kartı modal — Detay / Liste sekme çubuğu (light + dark okunur) */
.stats-modal-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    min-height: 0;
}

.stats-modal-tab-nav {
    display: flex;
    gap: 0.35rem;
    padding: 0.3rem;
    border-radius: 0.7rem;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.stats-modal-tab-btn {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.45rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    background: transparent;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.stats-modal-tab-btn i {
    font-size: 0.95rem;
    opacity: 0.9;
}

.stats-modal-tab-btn:hover {
    color: #111827;
    background: #ffffff;
    border-color: #e5e7eb;
}

.stats-modal-tab-btn:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--kku-primary, #E30613) 55%, #fff);
    outline-offset: 2px;
}

.stats-modal-tab-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--kku-primary, #E30613) 0%, #b91c1c 100%);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(227, 6, 19, 0.35);
}

.stats-modal-tab-btn.active i {
    opacity: 1;
}

.stats-modal-tab-pane {
    display: none;
    min-height: 0;
}

.stats-modal-tab-pane.active {
    display: block;
}

@media (max-width: 520px) {
    .stats-modal-tab-nav {
        flex-direction: column;
    }

    .stats-modal-tab-btn {
        justify-content: flex-start;
    }
}

.stat-modal-search-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 280px;
}

.stat-modal-search-header {
    margin-bottom: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
}

.stat-modal-search-header .fakulte-list-count {
    width: 100%;
}

.stat-modal-search-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.stat-modal-search-input-wrap {
    flex: 1 1 220px;
    min-width: 0;
}

.stat-modal-search-sort-wrap {
    position: relative;
    flex: 0 0 auto;
    min-width: 148px;
    max-width: 180px;
}

.stat-modal-search-sort {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    padding: 0.5rem 2.1rem 0.5rem 0.85rem;
    border: 2px solid rgba(255, 255, 255, 0.32);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(10px);
}

.stat-modal-search-sort:hover {
    border-color: rgba(255, 255, 255, 0.48);
    background: rgba(255, 255, 255, 0.2);
}

.stat-modal-search-sort:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.24);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.stat-modal-search-sort option {
    color: #0f172a;
    background: #fff;
}

.stat-modal-search-sort-icon {
    position: absolute;
    right: 0.72rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.8rem;
}

.stat-modal-search-footer {
    display: flex;
    justify-content: center;
    padding-top: 0.35rem;
}

.stat-modal-search-footer .btn {
    border-radius: 999px;
    padding: 0.35rem 1.1rem;
    font-weight: 600;
}

.stat-modal-search-wrap--empty {
    min-height: 200px;
    padding: 0.5rem 0.25rem;
}

.stat-modal-search-results {
    max-height: min(52vh, 420px);
    overflow: auto;
    padding: 0.35rem 0.15rem 0.15rem 0;
    border-radius: 10px;
    background: color-mix(in srgb, var(--kku-surface-2, #f8fafc) 88%, transparent);
    border: 1px solid color-mix(in srgb, var(--kku-border, #e5e7eb) 70%, transparent);
}

.stat-modal-search-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem 0.5rem;
}

.stat-modal-search-empty {
    margin: 0;
    padding: 1.25rem 0.75rem;
    text-align: center;
    color: var(--kku-text-muted, #6b7280);
    font-size: 0.9rem;
}

.stat-modal-search-item .bolum-tree-item-subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.8125rem;
    color: var(--kku-text-muted, #6b7280);
}

#stats-modal.stats-modal-rich .kku-modal-content.large {
    max-width: min(920px, 96vw) !important;
    min-width: min(680px, 96vw);
}

#stats-modal.stats-modal-rich .kku-modal-content.xlarge {
    max-width: min(1000px, 96vw) !important;
    min-width: min(800px, 96vw);
}

