/* ===========================
   ADMIN PANEL - GENEL
   =========================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --red: #C8102E;
    --red-dark: #a00d24;
    --dark: #1a1a2e;
    --dark-2: #16213e;
    --white: #ffffff;
    --gray-light: #f5f5f5;
    --gray: #e0e0e0;
    --gray-dark: #666;
    --text: #333;
    --shadow: 0 4px 20px rgba(0,0,0,0.08);
    --transition: all 0.3s ease;
    --radius: 12px;
    --sidebar-width: 270px;
}

body {
    font-family: 'Open Sans', sans-serif;
    background: var(--gray-light);
    color: var(--text);
    display: flex;
    min-height: 100vh;
}

/* ===========================
   SIDEBAR
   =========================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--dark);
    color: var(--white);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 25px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo { width: 45px; height: 45px; border-radius: 50%; border: 2px solid var(--red); }
.sidebar-header h3 { font-family: 'Montserrat', sans-serif; font-size: 15px; font-weight: 700; }
.sidebar-header span { font-size: 11px; opacity: 0.6; }

.sidebar-nav {
    flex-grow: 1;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 25px; color: var(--white); text-decoration: none;
    font-size: 14px; font-weight: 500; transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-link:hover { background: rgba(255,255,255,0.05); border-left-color: rgba(200,16,46,0.5); }
.nav-link.active { background: rgba(200,16,46,0.15); border-left-color: var(--red); color: var(--red); font-weight: 700; }
.nav-link i { width: 20px; text-align: center; font-size: 15px; }

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; flex-direction: column; gap: 8px;
}

.back-site, .logout-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 15px; border-radius: 8px;
    color: var(--white); text-decoration: none;
    font-size: 13px; font-weight: 600; transition: var(--transition);
}
.back-site:hover { background: rgba(255,255,255,0.1); }
.logout-btn { background: rgba(200,16,46,0.2); }
.logout-btn:hover { background: var(--red); }

/* ===========================
   ANA İÇERİK
   =========================== */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 0;
    min-height: 100vh;
}

.admin-header {
    background: var(--white);
    padding: 15px 30px;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky; top: 0; z-index: 50;
}

.admin-header h2 { font-family: 'Montserrat', sans-serif; font-size: 20px; color: var(--dark); }

.menu-toggle {
    display: none; background: none; border: none;
    font-size: 20px; color: var(--dark); cursor: pointer;
}

.admin-user { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--dark); color: var(--white);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800; font-family: 'Montserrat', sans-serif;
}
.admin-user span { font-size: 14px; font-weight: 600; color: var(--dark); }

/* Sayfalar */
.page { display: none; padding: 30px; }
.page.active { display: block; }

/* ===========================
   STAT KARTLARI
   =========================== */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card-admin {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex; align-items: center; gap: 18px;
}

.stat-admin-icon {
    width: 55px; height: 55px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}

.stat-card-admin h3 { font-family: 'Montserrat', sans-serif; font-size: 26px; color: var(--dark); }
.stat-card-admin p { font-size: 13px; color: var(--gray-dark); margin-top: 2px; }

/* ===========================
   ADMIN KART
   =========================== */
.admin-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 25px;
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--gray);
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 10px;
}

.card-header h3 { font-family: 'Montserrat', sans-serif; font-size: 17px; color: var(--dark); display: flex; align-items: center; gap: 8px; }
.card-header h3 i { color: var(--red); }

.view-all { color: var(--red); font-weight: 600; font-size: 13px; text-decoration: none; cursor: pointer; }

.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.search-input {
    padding: 8px 14px; border: 2px solid var(--gray); border-radius: 8px;
    font-size: 13px; width: 200px; transition: var(--transition);
}
.search-input:focus { border-color: var(--red); outline: none; }

.filter-select {
    padding: 8px 14px; border: 2px solid var(--gray); border-radius: 8px;
    font-size: 13px; background: var(--white); cursor: pointer;
}

/* ===========================
   TABLO
   =========================== */
.table-wrapper { overflow-x: auto; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { background: var(--gray-light); padding: 12px 20px; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--gray-dark); font-weight: 700; }
.admin-table td { padding: 14px 20px; border-bottom: 1px solid var(--gray); font-size: 14px; }
.admin-table tr:hover { background: rgba(200,16,46,0.02); }

.status {
    display: inline-block; padding: 4px 12px; border-radius: 20px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.status.pending { background: #FFF3E0; color: #E65100; }
.status.progress { background: #E3F2FD; color: #1565C0; }
.status.completed { background: #E8F5E9; color: #2E7D32; }
.status.rejected { background: #FFEBEE; color: #C62828; }

.actions { display: flex; gap: 8px; }
.action-btn {
    width: 34px; height: 34px; border: none; border-radius: 8px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 13px; transition: var(--transition);
}
.action-btn.edit { background: #E3F2FD; color: #1565C0; }
.action-btn.edit:hover { background: #1565C0; color: var(--white); }
.action-btn.delete { background: #FFEBEE; color: #C62828; }
.action-btn.delete:hover { background: #C62828; color: var(--white); }
.action-btn.approve { background: #E8F5E9; color: #2E7D32; }
.action-btn.approve:hover { background: #2E7D32; color: var(--white); }
.action-btn.reject { background: #FFEBEE; color: #C62828; }
.action-btn.reject:hover { background: #C62828; color: var(--white); }
.action-btn.complete { background: #E8F5E9; color: #2E7D32; }
.action-btn.complete:hover { background: #2E7D32; color: var(--white); }

.done-text { font-size: 12px; color: var(--gray-dark); font-weight: 600; }

.cat-badge {
    display: inline-block; padding: 3px 10px; border-radius: 4px;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
}
.cat-muhtelif { background: #E65100; color: var(--white); }
.cat-medikal { background: #2E7D32; color: var(--white); }
.cat-elektronik { background: #1565C0; color: var(--white); }

/* ===========================
   FORM
   =========================== */
.admin-form { padding: 25px; }
.form-row-admin { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-group-admin { margin-bottom: 20px; }
.form-group-admin label { display: block; font-size: 14px; font-weight: 600; color: var(--dark); margin-bottom: 8px; }
.form-group-admin input,
.form-group-admin select,
.form-group-admin textarea {
    width: 100%; padding: 12px 16px; border: 2px solid var(--gray);
    border-radius: 8px; font-size: 14px; font-family: 'Open Sans', sans-serif;
    transition: var(--transition); background: var(--gray-light);
}
.form-group-admin input:focus,
.form-group-admin select:focus,
.form-group-admin textarea:focus {
    border-color: var(--red); outline: none; background: var(--white);
}
.form-group-admin textarea { resize: vertical; min-height: 100px; }

.file-upload {
    border: 2px dashed var(--gray); border-radius: var(--radius);
    padding: 40px; text-align: center; cursor: pointer;
    transition: var(--transition); background: var(--gray-light);
}
.file-upload:hover { border-color: var(--red); background: rgba(200,16,46,0.03); }
.file-upload i { font-size: 40px; color: var(--gray-dark); margin-bottom: 10px; }
.file-upload p { font-size: 14px; color: var(--text); font-weight: 600; }
.file-upload span { font-size: 12px; color: var(--gray-dark); }

.image-preview { position: relative; display: inline-block; margin-top: 15px; }
.image-preview img { width: 200px; height: 150px; object-fit: cover; border-radius: 8px; border: 2px solid var(--gray); }
.remove-img {
    position: absolute; top: -8px; right: -8px;
    width: 28px; height: 28px; border-radius: 50%;
    background: var(--red); color: var(--white); border: none;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 12px;
}

.form-actions { display: flex; justify-content: flex-end; gap: 12px; padding-top: 10px; }

.btn-admin {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border: none; border-radius: 8px;
    font-size: 14px; font-weight: 700; font-family: 'Montserrat', sans-serif;
    cursor: pointer; transition: var(--transition);
}
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(200,16,46,0.3); }
.btn-secondary { background: var(--gray-light); color: var(--text); border: 2px solid var(--gray); }
.btn-secondary:hover { background: var(--gray); }

/* ===========================
   KATEGORİ İSTATİSTİK BARLARI
   =========================== */
.category-stats { padding: 25px; }
.cat-stat-item { margin-bottom: 20px; }
.cat-stat-bar { height: 12px; background: var(--gray-light); border-radius: 6px; overflow: hidden; margin-bottom: 8px; }
.cat-bar { height: 100%; border-radius: 6px; transition: width 1s ease; }
.muhtelif-bar { background: #E65100; }
.medikal-bar { background: #2E7D32; }
.elektronik-bar { background: #1565C0; }
.cat-stat-info { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.cat-stat-info strong { color: var(--dark); }
.cat-stat-info span:last-child { color: var(--gray-dark); margin-left: auto; }

/* ===========================
   PDF İNDİRME
   =========================== */
.pdf-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 25px;
}

.pdf-card {
    padding: 30px;
    border: 2px solid var(--gray);
    border-radius: var(--radius);
    text-align: center;
    transition: var(--transition);
}
.pdf-card:hover { border-color: var(--red); transform: translateY(-3px); box-shadow: var(--shadow); }
.pdf-card i { font-size: 40px; color: var(--red); margin-bottom: 15px; }
.pdf-card h4 { font-family: 'Montserrat', sans-serif; font-size: 16px; color: var(--dark); margin-bottom: 8px; }
.pdf-card p { font-size: 13px; color: var(--gray-dark); margin-bottom: 20px; line-height: 1.5; }

/* ===========================
   TOAST
   =========================== */
.toast {
    position: fixed; bottom: 30px; right: 30px;
    background: #2E7D32; color: var(--white);
    padding: 14px 24px; border-radius: 10px;
    display: flex; align-items: center; gap: 10px;
    font-size: 14px; font-weight: 600;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
    transform: translateY(100px); opacity: 0;
    transition: var(--transition); z-index: 9999;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.error { background: #C62828; }

/* ===========================
   YENİ EKLENEN STİLLER (Firebase Entegrasyonu)
   =========================== */

/* Talep sayısı rozeti */
.badge-count {
    background: var(--red);
    color: var(--white);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 8px;
}

/* Boş durumu (Henüz talep yok mesajı) */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-dark);
}

.empty-state i {
    font-size: 50px;
    color: var(--gray);
    margin-bottom: 15px;
    display: block;
}

.empty-state p {
    font-size: 15px;
}

/* Yeni gelen talep vurgusu (Okunmamış) */
.admin-table tr.new-request {
    background: rgba(200,16,46,0.05);
    border-left: 3px solid var(--red);
}

.admin-table tr.new-request td:first-child::before {
    content: '🔴 ';
    margin-right: 4px;
}

/* Mesaj görüntüleme butonu (Mavi - Görüntüle) */
.action-btn.view {
    background: #E3F2FD;
    color: #1565C0;
}

.action-btn.view:hover {
    background: #1565C0;
    color: var(--white);
}

/* Ürün listesindeki görsel önizleme */
.admin-table td img {
    transition: transform 0.3s ease;
}

.admin-table td img:hover {
    transform: scale(1.5);
    z-index: 10;
    position: relative;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

/* Dashboard - Hızlı aksiyon butonları */
.btn-admin[data-goto] {
    text-decoration: none;
    flex-direction: column;
    gap: 12px;
    font-size: 14px;
}

.btn-admin[data-goto] i {
    font-size: 28px;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 1024px) {
    .stats-cards { grid-template-columns: repeat(2, 1fr); }
    .pdf-actions { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { left: -280px; }
    .sidebar.open { left: 0; }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .form-row-admin { grid-template-columns: 1fr; }
    .stats-cards { grid-template-columns: 1fr; }
    .admin-header h2 { font-size: 16px; }
    .admin-user span { display: none; }
}
/* ===========================
   MALZEME CHIP'LERİ
   =========================== */
.material-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: var(--gray-light);
    border-radius: 10px;
    border: 2px solid var(--gray);
}

.material-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--white);
    border: 2px solid var(--gray);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    font-family: 'Montserrat', sans-serif;
}

.material-chip:hover {
    border-color: var(--red);
    color: var(--red);
    transform: translateY(-1px);
}

.material-chip.selected {
    background: var(--red);
    color: var(--white);
    border-color: var(--red);
    box-shadow: 0 4px 10px rgba(200,16,46,0.3);
}

.material-chip.selected::before {
    content: '✓';
    font-weight: 700;
    margin-right: 6px;
}