/* ==========================================================================
   KOPARCRAFT YÖNETİM PANELİ ANA STİL DOSYASI (STYLE.CSS)
   ========================================================================== */

/* Genel Sıfırlama ve Temel Kurallar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8fafc;
    color: #334155;
    line-height: 1.5;
}

/* Admin Düzeni (Masaüstü Varsayılan) */
.admin-body {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: #1e293b;
    color: #fff;
    padding: 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1000;
}

.admin-main {
    margin-left: 260px;
    width: calc(100% - 260px);
    padding: 30px;
    transition: all 0.3s ease;
}

/* Üst Bar (Header) ve Sayfa Başlıkları */
.admin-header {
    background: #fff;
    padding: 15px 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.page-header h1 {
    font-size: 1.75rem;
    color: #1e293b;
}

/* Kart Yapıları (Dashboard & Form Panelleri) */
.dashboard-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
    border: 1px solid #e2e8f0;
    margin-bottom: 25px;
}

.card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    font-size: 1.1rem;
    color: #1e293b;
}

.card-body {
    padding: 20px;
}

/* Grid Düzenleri (Masaüstü) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 25px;
}

/* İstatistik Kartları */
.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-primary .stat-icon { background: #eff6ff; color: #2563eb; }
.stat-success .stat-icon { background: #ecfdf5; color: #10b981; }
.stat-warning .stat-icon { background: #fff7ed; color: #f59e0b; }
.stat-danger .stat-icon  { background: #fef2f2; color: #ef4444; }

.stat-info h3 {
    font-size: 1.5rem;
    color: #1e293b;
    font-weight: 700;
}

.stat-info p {
    color: #64748b;
    font-size: 0.875rem;
}

/* Form Elemanları Tasarımı */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #475569;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: #fff;
    color: #334155;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* Butonlar */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-block { display: flex; width: 100%; justify-content: center; }

.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }
.btn-secondary { background: #64748b; color: #fff; }
.btn-secondary:hover { background: #475569; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-info { background: #0ea5e9; color: #fff; }
.btn-info:hover { background: #0284c7; }

/* Genel Veri Tablosu Stili */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    text-align: left;
}

.table th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 600;
    padding: 12px 15px;
    border-bottom: 2px solid #e2e8f0;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
    vertical-align: middle;
}

.table tr:hover {
    background-color: #f8fafc;
}

/* Rozetler (Badge) */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    text-align: center;
}

.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-info { background: #e0f2fe; color: #0369a1; }

/* Uyarı Kutuları (Alerts) */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-info { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }

/* ==========================================================================
   💥 KOPARCRAFT GLOBAL MOBİL AYAKLANMA REÇETESİ (TÜM SAYFALARI KURTARIR)
   ========================================================================== */

@media screen and (max-width: 1024px) {
    /* Tüm tarayıcılarda küresel kaymaları ve beyaz yırtılmaları engelle */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Admin flex esnekliğini mobilde block akışına çevirerek sıkışmayı bitir */
    .admin-body {
        display: block !important;
        width: 100% !important;
    }
    
    /* Yan Menüyü (Sidebar) tam ekran dikey akışa zorla */
    .sidebar {
        width: 100% !important;
        position: relative !important;
        height: auto !important;
        min-height: auto !important;
        padding: 15px !important;
        top: 0 !important;
        left: 0 !important;
        display: block !important;
        transform: none !important;
    }
    
    /* 🚨 İŞTE YARIM GÖRÜNMEYİ BİTİREN EMİR: Tüm sayfalardaki .admin-main genişliğini %100 yap */
    .admin-main {
        margin-left: 0 !important;
        margin-top: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 15px !important;
        position: relative !important;
        top: 0 !important;
        box-sizing: border-box !important;
        display: block !important;
    }

    /* Üst yönetim başlık barının kaymalarını sıfırla ve tepeye eşitle */
    .admin-header {
        position: relative !important;
        width: 100% !important;
        top: 0 !important;
        margin: 0 !important;
        margin-bottom: 20px !important;
        padding: 15px !important;
        box-sizing: border-box !important;
        flex-direction: column !important;
        gap: 10px;
        text-align: center;
    }

    .admin-content {
        padding: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .page-header {
        flex-direction: column !important;
        gap: 12px;
        align-items: stretch !important;
        text-align: center;
    }
    
    .page-header .btn {
        width: 100%;
        justify-content: center;
    }

    /* 📋 Ürün listesi ve sipariş tablolarının kesilmesini önleyen akıllı yatay kaydırma */
    .card-body, .dashboard-card, div[class*="responsive"], table {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .table {
        width: 100% !important;
        min-width: 750px !important; /* Hücre yazıları sıkışmaz, parmakla sağa kaydırılır */