/* ═══════════════════════════════════════════════
 * NDE Dashboard — Kursiyer & Eğitmen Paneli CSS
 * @version 1.7.0
 * ═══════════════════════════════════════════════ */

/* ── Dashboard Kartlar ── */
.nde-dcard {
    background: #fff;
    border: 1px solid var(--nde-gray-200, #E5E7EB);
    border-radius: 12px;
    overflow: hidden;
}

.nde-dcard__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--nde-gray-200, #E5E7EB);
    background: var(--nde-gray-50, #F8F9FA);
}

.nde-dcard__header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--nde-gray-800, #1F2937);
}

.nde-dcard__header svg {
    color: var(--nde-primary, #1B3A5C);
    flex-shrink: 0;
}

.nde-dcard__meta {
    margin-left: auto;
    font-size: 0.813rem;
    color: var(--nde-gray-500, #6B7280);
    font-weight: 500;
}

.nde-dcard__body {
    padding: 20px;
}

.nde-dcard__note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 14px;
    background: #FEF3C7;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #92400E;
}

.nde-dcard__note svg {
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Durum Grid ── */
.nde-dstatus-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.nde-dstatus-item {
    padding: 14px;
    background: var(--nde-gray-50, #F8F9FA);
    border-radius: 8px;
    text-align: center;
}

.nde-dstatus-item__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--nde-gray-500, #6B7280);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 6px;
}

.nde-dstatus-item__value {
    font-size: 0.938rem;
    font-weight: 600;
    color: var(--nde-gray-800, #1F2937);
}

/* ── Dashboard Badge'ler ── */
.nde-dbadge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.nde-dbadge--kabul {
    background: #D1FAE5;
    color: #065F46;
}

.nde-dbadge--yedek {
    background: #FEF3C7;
    color: #92400E;
}

.nde-dbadge--red {
    background: #FEE2E2;
    color: #991B1B;
}

.nde-dbadge--beklemede {
    background: #DBEAFE;
    color: #1E40AF;
}

.nde-dbadge--belirlenmedi {
    background: var(--nde-gray-100, #F3F4F6);
    color: var(--nde-gray-500, #6B7280);
}

/* ── Dashboard Tablo ── */
.nde-dtable {
    width: 100%;
    border-collapse: collapse;
}

.nde-dtable td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--nde-gray-100, #F3F4F6);
    font-size: 0.875rem;
    vertical-align: middle;
}

.nde-dtable tr:last-child td {
    border-bottom: none;
}

.nde-dtable__label {
    font-weight: 600;
    color: var(--nde-gray-500, #6B7280);
    width: 180px;
    white-space: nowrap;
}

/* ── Bildirim Satırları ── */
.nde-notif-row {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--nde-gray-100, #F3F4F6);
    transition: background 0.15s;
}

.nde-notif-row:last-child {
    border-bottom: none;
}

.nde-notif-row--unread {
    background: #EFF6FF;
}

.nde-notif-row__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nde-notif-row__icon--info {
    background: #DBEAFE;
    color: #1E40AF;
}

.nde-notif-row__icon--success {
    background: #D1FAE5;
    color: #065F46;
}

.nde-notif-row__icon--warning {
    background: #FEF3C7;
    color: #92400E;
}

.nde-notif-row__body {
    flex: 1;
    min-width: 0;
}

.nde-notif-row__title {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--nde-gray-800, #1F2937);
    margin-bottom: 2px;
}

.nde-notif-row__text {
    font-size: 0.813rem;
    color: var(--nde-gray-600, #4B5563);
    line-height: 1.5;
}

.nde-notif-row__time {
    font-size: 0.75rem;
    color: var(--nde-gray-400, #9CA3AF);
    margin-top: 4px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .nde-dstatus-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nde-dtable__label {
        width: 140px;
    }
}

@media (max-width: 480px) {
    .nde-dstatus-grid {
        grid-template-columns: 1fr;
    }

    .nde-dcard__header {
        flex-wrap: wrap;
    }

    .nde-dcard__meta {
        margin-left: 0;
        width: 100%;
    }

    .nde-dtable__label {
        width: 120px;
        font-size: 0.813rem;
    }

    .nde-dtable td {
        padding: 10px;
        font-size: 0.813rem;
    }
}

/* ── Dashboard Tam Sayfa Layout ── */
.nde-panel-page .nde-dashboard {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: calc(100vh - 56px);
}

.nde-panel-page .nde-sidebar {
    position: sticky;
    top: 56px;
    height: calc(100vh - 56px);
    overflow-y: auto;
    flex-shrink: 0;
}

.nde-panel-page .nde-dashboard__content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 2rem;
    background: var(--nde-gray-50, #F8FAFC);
}

@media (max-width: 768px) {
    .nde-panel-page .nde-sidebar {
        top: 52px;
        height: auto;
        position: relative;
    }
    .nde-panel-page .nde-dashboard {
        flex-direction: column;
        min-height: calc(100vh - 52px);
    }
    .nde-panel-page .nde-dashboard__content {
        padding: 1rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
 * MOBİL OVERRIDE'LARI (v1.5.0)
 *
 * Inline style="..." attribute'ları CSS specificity'de stylesheet
 * kurallarını ezer; bu yüzden mobile breakpoint'lerde !important
 * gerekiyor. Uzun vadede tüm inline style'lar utility class'lara
 * (ör. .nde-flex, .nde-gap-1) taşınmalı.
 * ═══════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    /* Genel Bakış kartları 2 sütun → tek sütun yerine */
    .nde-stats {
        grid-template-columns: 1fr 1fr !important;
        gap: .75rem !important;
    }
    .nde-stat-card {
        padding: .85rem !important;
    }
    .nde-stat-card__value {
        font-size: 1.35rem !important;
    }
    .nde-stat-card__icon {
        width: 36px !important;
        height: 36px !important;
    }

    /* Dashboard header — başlık + breadcrumb mobil sıkıştırma */
    .nde-dashboard__title {
        font-size: 1.25rem !important;
    }
    .nde-dashboard__breadcrumb {
        font-size: .75rem !important;
    }

    /* Kurs/ders kartları — thumbnail küçült */
    .nde-dcard__body img {
        width: 80px !important;
        height: 56px !important;
    }

    /* Tablo satırlarında padding az */
    .nde-dtable td {
        padding: 8px !important;
    }

    /* Stat hub'ı (kurs detay 5 kart) — 2 sütun */
    .nde-kurs-stats-hub {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ═══════════════════════════════════════════════════════════════
 * UTILITY CLASS'LARI (v1.5.0)
 *
 * Inline style yerine kullanılması için. Yeni kodlarda öncelik bu.
 * ═══════════════════════════════════════════════════════════════ */

.nde-flex { display: flex; }
.nde-flex-wrap { flex-wrap: wrap; }
.nde-flex-col { flex-direction: column; }
.nde-items-center { align-items: center; }
.nde-justify-between { justify-content: space-between; }
.nde-gap-0_5 { gap: .5rem; }
.nde-gap-1 { gap: 1rem; }
.nde-gap-1_5 { gap: 1.5rem; }
.nde-mt-0_5 { margin-top: .5rem; }
.nde-mt-1 { margin-top: 1rem; }
.nde-mb-1 { margin-bottom: 1rem; }
.nde-mb-1_5 { margin-bottom: 1.5rem; }
.nde-flex-1 { flex: 1; min-width: 0; }
.nde-text-sm { font-size: .8rem; }
.nde-text-xs { font-size: .75rem; }
.nde-text-muted { color: var(--nde-gray-500); }
.nde-w-full { width: 100%; }

/* Soluk / disabled stat card (sayı=0 ise tıklanamaz görünüm) */
a.nde-stat-card.is-empty,
.nde-stat-card.is-empty {
    opacity: .55;
    pointer-events: none;
    cursor: default;
}

/* Ders tamamlama sonrası otomatik geçiş animasyonu */
.nde-autonext-banner {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #d1fae5, #ecfdf5);
    border: 1px solid #6ee7b7;
    border-radius: 10px;
    color: #065f46;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .75rem;
}
.nde-autonext-banner__countdown {
    margin-left: auto;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--nde-primary, #1B3A5C);
    min-width: 2ch;
    text-align: center;
}

/* Sınav timer — mobil sticky */
@media (max-width: 768px) {
    .nde-sinav-take .nde-timer {
        position: sticky;
        top: 56px;
        z-index: 50;
        align-self: flex-end;
        box-shadow: 0 2px 8px rgba(0,0,0,.15);
    }
}

/* PDF "mobilde aç" buton stilini iyileştir */
.nde-pdf-mobile-cta {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    background: #fff3e0;
    border: 1px solid #ffcc80;
    border-radius: 8px;
    color: #e65100;
    text-decoration: none;
    font-weight: 600;
    font-size: .9rem;
    margin-top: .5rem;
}
.nde-pdf-mobile-cta:hover {
    background: #ffe0b2;
}

/* ═══════════════════════════════════════════════════════════════
 * #1.6.0: MOBİL — TABLO → KART DÖNÜŞÜMÜ
 *
 * Yönetici/eğitmen panellerinde tabloları mobilde kart olarak göster.
 * Kullanım: <table class="nde-responsive-table">
 *   <thead><tr><th>Ad</th><th>E-posta</th>...</tr></thead>
 *   <tbody><tr>
 *     <td data-label="Ad">...</td>
 *     <td data-label="E-posta">...</td>
 *   </tr></tbody>
 * </table>
 *
 * Mobilde her satır bağımsız kart olur; başlıklar inline label olarak görünür.
 * ═══════════════════════════════════════════════════════════════ */

@media (max-width: 640px) {
    .nde-responsive-table {
        border: none !important;
    }
    .nde-responsive-table thead {
        position: absolute;
        left: -9999px;
        width: 1px;
        height: 1px;
        overflow: hidden;
    }
    .nde-responsive-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid var(--nde-gray-200);
        border-radius: 10px;
        margin-bottom: 12px;
        padding: 12px 14px;
        box-shadow: 0 1px 2px rgba(0,0,0,.04);
    }
    .nde-responsive-table tbody td {
        display: flex !important;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        padding: 6px 0 !important;
        border: none !important;
        border-top: 1px dashed var(--nde-gray-100) !important;
        font-size: .85rem !important;
        text-align: left !important;
    }
    .nde-responsive-table tbody td:first-child {
        border-top: none !important;
        padding-top: 0 !important;
        font-weight: 600;
        font-size: .95rem !important;
        color: var(--nde-gray-800);
    }
    .nde-responsive-table tbody td::before {
        content: attr(data-label);
        font-size: .72rem;
        text-transform: uppercase;
        letter-spacing: .5px;
        color: var(--nde-gray-500);
        font-weight: 600;
        flex-shrink: 0;
        min-width: 80px;
    }
    .nde-responsive-table tbody td:first-child::before {
        display: none; /* Ad/Başlık satırında label yerine sadece değer */
    }
    /* Action butonları satır içinde sağa yaslı */
    .nde-responsive-table tbody td[data-label="İşlem"],
    .nde-responsive-table tbody td[data-label="Action"],
    .nde-responsive-table tbody td.is-action {
        justify-content: flex-end;
        padding-top: 10px !important;
        margin-top: 4px;
    }
}

/* ═══════════════════════════════════════════════════════════════
 * #1.6.0: SIK KULLANILAN COMPONENT CLASS'LARI
 *
 * Aşamalı inline-style → component CSS geçişinin ilk turu.
 * Dashboard'daki en çok tekrarlanan inline pattern'leri buraya taşı.
 * ═══════════════════════════════════════════════════════════════ */

/* Tablo TH stili (yönetici tabloları) */
.nde-th {
    text-align: left;
    padding: .6rem 1rem;
    font-size: .775rem;
    color: var(--nde-gray-500);
    font-weight: 600;
    border-bottom: 1px solid var(--nde-gray-200);
}
.nde-th--right { text-align: right; }
.nde-th--center { text-align: center; }

/* Tablo TD stili */
.nde-td-name { padding: .6rem 1rem; font-size: .875rem; font-weight: 500; }
.nde-td-meta { padding: .6rem .75rem; font-size: .8rem; color: var(--nde-gray-600); }
.nde-td-mini { padding: .6rem .75rem; font-size: .75rem; color: var(--nde-gray-500); }
.nde-td-action { padding: .6rem .75rem; text-align: right; white-space: nowrap; }

/* Boş durum tek satırlık alert */
.nde-empty-state {
    color: var(--nde-gray-400);
    text-align: center;
    padding: 1.5rem;
    font-size: .9rem;
}

/* Inline gri thumb (varsayılan resim placeholder yerine) */
.nde-thumb-fallback {
    width: 80px;
    height: 56px;
    background: var(--nde-gray-100);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--nde-gray-400);
    font-size: 1.5rem;
}

/* Tablo body action butonları boşluğu */
.nde-action-row {
    display: inline-flex;
    gap: .4rem;
    flex-wrap: wrap;
}

/* Durum badge'leri */
.nde-status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1.5;
}
.nde-status-badge--success { background: #d1fae5; color: #065f46; }
.nde-status-badge--danger  { background: #fee2e2; color: #991b1b; }
.nde-status-badge--warning { background: #fef3c7; color: #92400e; }
.nde-status-badge--info    { background: #dbeafe; color: #1e40af; }
.nde-status-badge--muted   { background: #f3f4f6; color: #374151; }

/* ═══════════════════════════════════════════════════════════════
 * #1.7.0: INLINE STYLE REFACTOR — TUR 2
 *
 * v1.6.0'da temel framework eklendi. Bu turda dashboard.php +
 * kurs-yoneticisi.php'deki en sık 25 inline style pattern'i utility
 * class'larına çevrildi (~430 tekrar). Sed ile toplu replacement
 * yapıldı; tek dokunulmayan kısımlar dinamik renkler/genişlikler
 * (örn. width:<?php echo $pct ?>%) — bunlar inline kalmalı.
 * ═══════════════════════════════════════════════════════════════ */

/* Form label - 56 yerde kullanılıyor */
.nde-form-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--nde-gray-700);
    margin-bottom: .25rem;
}
.nde-form-label--mb3 { margin-bottom: .3rem; }

/* Genel input - 35 yerde */
.nde-form-input {
    width: 100%;
    padding: .4rem .65rem;
    border: 1px solid var(--nde-gray-300);
    border-radius: 6px;
    font-size: .875rem;
}
.nde-form-input--lg {
    padding: .45rem .75rem;
}

/* Form linkler */
.nde-link {
    color: var(--nde-primary);
    text-decoration: none;
}
.nde-link:hover { text-decoration: underline; }

/* Margin utility'ler */
.nde-mb-0_75 { margin-bottom: .75rem; }
.nde-mb-1_25 { margin-bottom: 1.25rem; }

/* Tablo TH stilleri (3 farklı varyant — gri-600/500 ve farklı padding'ler) */
.nde-th-md {
    text-align: left;
    padding: .75rem 1rem;
    font-size: .8125rem;
    color: var(--nde-gray-600);
}
.nde-th-sm {
    text-align: left;
    padding: .65rem .75rem;
    font-size: .8rem;
    color: var(--nde-gray-500);
    font-weight: 600;
    border-bottom: 1px solid var(--nde-gray-200);
}
.nde-th-xs {
    text-align: left;
    padding: .6rem .75rem;
    font-size: .775rem;
    color: var(--nde-gray-500);
}
.nde-th-xxs {
    text-align: left;
    padding: .55rem .75rem;
    font-size: .775rem;
    color: var(--nde-gray-500);
    font-weight: 600;
    border-bottom: 1px solid var(--nde-gray-200);
}

/* Tablo container'ları */
.nde-table-wrap {
    padding: 0;
    overflow-x: auto;
}
.nde-table-base {
    width: 100%;
    border-collapse: collapse;
}
.nde-table-head-bg {
    background: var(--nde-gray-50);
}

/* Generic td'ler */
.nde-td-md {
    padding: .75rem 1rem;
    font-size: .875rem;
    color: var(--nde-gray-600);
}

/* Row borders */
.nde-row-divider-t { border-top: 1px solid var(--nde-gray-100); }
.nde-row-divider-b { border-bottom: 1px solid var(--nde-gray-100); }
.nde-row-divider-b200 { border-bottom: 1px solid var(--nde-gray-200); }

/* Grid full-width */
.nde-grid-full { grid-column: 1 / -1; }

/* Card padding'ler */
.nde-p-md { padding: 1.25rem 1.5rem; }
.nde-p-sm { padding: .65rem .75rem; }
.nde-p-row { padding: .75rem 1rem; }
.nde-p-0 { padding: 0; }

/* Stat card empty zaten v1.5.0'da eklendi */

/* ════════════════════════════════════════════════
 * Sistem Sağlığı Kartı (#1.8.7)
 * Kurs Yöneticisi Panosu — render_health_card()
 * ════════════════════════════════════════════════ */
.nde-health { width: 100%; }

.nde-health__summary {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.nde-health__summary::-webkit-details-marker { display: none; }
.nde-health__summary::before {
    content: "▸";
    color: var(--nde-gray-400);
    font-size: .85rem;
    transition: transform .15s ease;
}
.nde-health[open] .nde-health__summary::before { transform: rotate(90deg); }

.nde-health__title {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .95rem;
    color: var(--nde-gray-800);
}
.nde-health__badge {
    padding: 2px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
}
.nde-health__count {
    margin-left: auto;
    font-size: .78rem;
    color: var(--nde-gray-500);
}

.nde-health__list {
    border-top: 1px solid var(--nde-gray-100);
}
.nde-health__item {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .8rem 1.25rem;
    border-bottom: 1px solid var(--nde-gray-100);
}
.nde-health__item:last-child { border-bottom: none; }

.nde-health__dot {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    margin-top: 1px;
}
.nde-health__body { min-width: 0; }
.nde-health__label {
    font-size: .87rem;
    font-weight: 600;
    color: var(--nde-gray-800);
}
.nde-health__msg {
    margin-top: 2px;
    font-size: .8rem;
    color: var(--nde-gray-600);
    line-height: 1.45;
}
.nde-health__fix {
    display: inline-block;
    margin-top: .35rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--nde-primary);
    text-decoration: none;
}
.nde-health__fix:hover { text-decoration: underline; }

.nde-health__footer {
    padding: .7rem 1.25rem;
    border-top: 1px solid var(--nde-gray-100);
    background: var(--nde-gray-50);
}
.nde-health__footer .nde-health__fix { margin-top: 0; }

@media (max-width: 600px) {
    .nde-health__count { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .nde-health__summary::before { transition: none; }
}

/* ════════════════════════════════════════════════
 * Eğitmen Görev Merkezi (#1.8.8)
 * Eğitmen Paneli > Genel Bakış — render_gorev_merkezi()
 * ════════════════════════════════════════════════ */
.nde-gorev-grup {
    border-bottom: 1px solid var(--nde-gray-200);
}
.nde-gorev-grup:last-child { border-bottom: none; }

.nde-gorev-grup__baslik {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1.25rem;
    background: var(--nde-gray-50);
    font-size: .8rem;
    font-weight: 700;
}
.nde-gorev-grup__nokta {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nde-gorev-satir {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .8rem 1.25rem;
    border-top: 1px solid var(--nde-gray-100);
    flex-wrap: wrap;
}
.nde-gorev-satir__bilgi {
    flex: 1;
    min-width: 0;
}
.nde-gorev-satir__ad {
    font-size: .9rem;
    font-weight: 600;
    color: var(--nde-gray-800);
}
.nde-gorev-satir__alt {
    margin-top: 2px;
    font-size: .78rem;
    color: var(--nde-gray-500);
    line-height: 1.45;
}

@media (max-width: 600px) {
    .nde-gorev-satir { align-items: stretch; }
    .nde-gorev-satir .nde-btn { width: 100%; text-align: center; }
}
