/* =========================================
   1. DEĞİŞKENLER VE TEMEL AYARLAR
   ========================================= */
:root {
    --bg-color: #f8f9fc; /* Arka plan: Çok açık gri */
    --surface: #ffffff; /* Kart zeminleri: Beyaz */
    --text-primary: #1e293b; /* Ana metin: Koyu antrasit */
    --text-secondary: #64748b; /* İkincil metin: Gri */
    --border-color: #e2e8f0; /* Çizgiler */
    /* Marka Renkleri */
    --primary-blue: #3b82f6; /* Mavi (Ana renk) */
    --primary-hover: #2563eb; /* Mavi (Hover) */
    --success-green: #10b981; /* Yeşil (Başarılı/Yenilik) */
    --danger-red: #ef4444; /* Kırmızı (Hata) */

    --radius: 12px; /* Genel köşe yuvarlaklığı */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif; /* Modern Font */
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
}

a {
    text-decoration: none;
}

/* =========================================
   2. SIDEBAR (SOL MENÜ)
   ========================================= */
.sidebar {
    width: 260px;
    background-color: var(--surface);
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100%;
    z-index: 100;
    overflow-y: auto;
}

.logo-area {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

    .menu-item:hover {
        background-color: #f1f5f9;
        color: var(--text-primary);
    }

    .menu-item.active {
        background-color: #eff6ff;
        color: var(--primary-blue);
        font-weight: 600;
    }

.mt-auto {
    margin-top: auto;
}

.menu-item.logout {
    color: var(--danger-red);
}

    .menu-item.logout:hover {
        background-color: #fef2f2;
    }

/* =========================================
   3. ANA İÇERİK ALANI (MAIN CONTENT)
   ========================================= */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 32px 48px;
    max-width: 1600px;
    width: 100%;
}

/* Header */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.page-title p {
    color: var(--text-secondary);
    margin-top: 4px;
}

/* =========================================
   4. DASHBOARD - KPI KARTLARI
   ========================================= */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 30px;
}

.kpi-card {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.kpi-info h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1;
}

.kpi-info p {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.bg-blue-soft {
    background: #eff6ff;
    color: var(--primary-blue);
}

.bg-green-soft {
    background: #ecfdf5;
    color: var(--success-green);
}

.bg-red-soft {
    background: #fef2f2;
    color: var(--danger-red);
}

/* =========================================
   5. FİLTRE VE AKSİYON BAR
   ========================================= */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
    padding-bottom: 0;
}

.filter-tabs-left {
    display: flex;
    gap: 24px;
}

.filter-tab {
    padding: 0 4px 12px 4px;
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    position: relative;
    transition: color 0.3s;
}

    .filter-tab:hover {
        color: var(--text-primary);
    }

    .filter-tab.active {
        color: var(--primary-blue);
        font-weight: 600;
    }

        .filter-tab.active::after {
            content: '';
            position: absolute;
            bottom: -1px;
            left: 0;
            width: 100%;
            height: 2px;
            background-color: var(--primary-blue);
        }

/* Dashboard'daki Yeni Kayıt Butonu (Link olan) */
.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    margin-bottom: 8px;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

    .btn-primary:hover {
        background-color: var(--primary-hover);
        transform: translateY(-1px);
        box-shadow: 0 4px 6px rgba(59, 130, 246, 0.4);
    }

/* =========================================
   6. LİSTE ÖĞELERİ (AKIS)
   ========================================= */
.update-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.list-item {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: grid;
    grid-template-columns: 50px 2fr 1fr auto;
    align-items: start;
    gap: 24px;
    transition: all 0.3s ease;
}

    .list-item.hidden {
        display: none;
    }

    .list-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 25px -5px rgba(0,0,0,0.06);
        border-color: #cbd5e1;
    }

.icon-box {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.icon-hata {
    background: #fef2f2;
    color: var(--danger-red);
}

.icon-gelistirme {
    background: #eff6ff;
    color: var(--primary-blue);
}

.icon-yenilik {
    background: #ecfdf5;
    color: var(--success-green);
}

.item-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.item-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.item-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    width: fit-content;
    text-transform: uppercase;
}

.tag-hata {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fee2e2;
}

.tag-gelistirme {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
}

.tag-yenilik {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #d1fae5;
}

.item-date {
    font-size: 13px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 6px;
}

.item-action {
    display: flex;
    align-items: center;
    height: 100%;
    cursor: pointer;
    color: #cbd5e1;
}

/* =========================================
   7. MODERN FORM VE SÜRÜKLE BIRAK (YENİ KAYIT SAYFASI)
   ========================================= */
.create-page-container {
    display: flex;
    justify-content: center;
    padding-top: 40px;
    padding-bottom: 60px;
}

.modern-form-card {
    background: #ffffff;
    width: 100%;
    max-width: 650px;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.05); /* Soft ve Derin Gölge */
    border: 1px solid #f1f5f9;
}

.form-header {
    text-align: center;
    margin-bottom: 35px;
}

    .form-header h2 {
        font-size: 26px;
        font-weight: 800;
        color: #1e293b;
        margin-bottom: 8px;
        letter-spacing: -0.5px;
    }

    .form-header p {
        color: #64748b;
        font-size: 15px;
    }

/* --- Dropzone (Sürükle Bırak) Alanı --- */
.file-upload-wrapper {
    position: relative;
    margin-bottom: 24px;
}

/* Görünmez input */
.file-upload-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

/* Görünür Etiket (Kutu) */
.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    background-color: #f8fafc;
    transition: all 0.3s ease;
    text-align: center;
}

/* Hover ve Aktif Durumlar */
.file-upload-input:hover + .file-upload-label {
    border-color: var(--primary-blue);
    background-color: #eff6ff;
}

.file-upload-label.active {
    border-style: solid;
    border-color: var(--success-green);
    background-color: #ecfdf5;
}

.upload-icon {
    font-size: 32px;
    color: var(--primary-blue);
    margin-bottom: 12px;
    background: #dbeafe;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.upload-text {
    font-weight: 600;
    color: #334155;
    font-size: 15px;
}

.upload-subtext {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 4px;
}

/* --- Inputlar --- */
.input-group {
    margin-bottom: 20px;
}

.input-label {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 8px;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.modern-input, .modern-select, .modern-textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    background-color: #ffffff;
    color: #1e293b;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

    .modern-input:focus, .modern-select:focus, .modern-textarea:focus {
        border-color: var(--primary-blue);
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
        outline: none;
    }

    /* Readonly (MD5) alanı */
    .modern-input[readonly] {
        background-color: #f1f5f9;
        color: #64748b;
        font-family: 'Courier New', monospace; /* Kod fontu */
        font-size: 13px;
        cursor: default;
    }

.modern-textarea {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Form Butonları */
.form-footer {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 24px;
}

.btn-save {
    background-color: var(--primary-blue);
    color: white;
    padding: 14px 36px;
    border-radius: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
    transition: transform 0.2s;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

    .btn-save:hover {
        background-color: var(--primary-hover);
        transform: translateY(-2px);
    }

.btn-cancel {
    color: #64748b;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    padding: 10px 20px;
}

    .btn-cancel:hover {
        color: #1e293b;
        background-color: #f1f5f9;
        border-radius: 8px;
    }

/* =========================================
   8. MOBİL UYUMLULUK (RESPONSIVE)
   ========================================= */
@media (max-width: 1024px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .list-item {
        grid-template-columns: 50px 1fr;
        grid-template-rows: auto auto;
    }

    .item-meta {
        grid-column: 2;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .item-action {
        display: none;
    }

    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .filter-tabs-left {
        overflow-x: auto;
        width: 100%;
        padding-bottom: 5px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .modern-form-card {
        padding: 24px;
    }
}


/* --- UYGULAMA KÜTÜPHANESİ (APP GRID) --- */

.app-grid-container {
    display: grid;
    /* Ekran genişliğine göre otomatik sığdır (en az 280px genişliğinde kartlar) */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding-bottom: 40px;
}

.app-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%; /* Kartların boyunu eşitle */
}

    .app-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.1);
        border-color: #cbd5e1;
    }

/* Kartın Üstü */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.app-icon {
    width: 64px;
    height: 64px;
    background: #f8fafc;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #f1f5f9;
    overflow: hidden;
}

    .app-icon img {
        width: 48px;
        height: 48px;
        object-fit: contain;
    }

.fallback-icon {
    font-size: 32px;
    color: #94a3b8;
}

.app-badge {
    background: #eff6ff;
    color: var(--primary-blue);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Kartın Ortası */
.app-body h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
    /* Uzun isimleri ... ile kısalt */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

    .app-meta span {
        display: flex;
        align-items: center;
        gap: 6px;
    }

.restart-warning {
    font-size: 12px;
    color: #b45309;
    background: #fffbeb;
    padding: 6px 10px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    margin-top: 5px;
}

/* Kartın Altı */
.app-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background-color: #f1f5f9;
    color: #334155;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.2s;
    text-decoration: none;
    font-size: 14px;
}

    .btn-download:hover {
        background-color: var(--primary-blue);
        color: white;
    }