<?php
    $statusOptions = [
        ['value' => 'active', 'label' => 'Aktif'],
        ['value' => 'inactive', 'label' => 'Pasif'],
        ['value' => 'blocked', 'label' => 'Engelli'],
        ['value' => 'potential', 'label' => 'Potansiyel'],
    ];
?>

<?php if (isset($component)) { $__componentOriginalafd3b985888fa2a33a2082f2c35a64dc = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalafd3b985888fa2a33a2082f2c35a64dc = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.quick-view.layout','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('quick-view.layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
    <!-- ─── HEADER ─── -->
    <?php if (isset($component)) { $__componentOriginala42916bd54053bb95821e6cf6446ae2c = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginala42916bd54053bb95821e6cf6446ae2c = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.quick-view.header','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('quick-view.header'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
         <?php $__env->slot('avatar', null, ['class' => ''.e($supplier->type === 'corporate' ? 'corp' : '').'']); ?> 
            <?php echo e($supplier->initials); ?>

         <?php $__env->endSlot(); ?>

         <?php $__env->slot('title', null, []); ?> 
            <span class="inline-editable" data-id="<?php echo e($supplier->id); ?>" data-url="/agency/suppliers/<?php echo e($supplier->id); ?>/update-field" data-field="<?php echo e($supplier->type === 'corporate' ? 'company_name' : 'first_name'); ?>"><?php echo e($supplier->full_name); ?></span>
            <?php if($supplier->status === 'active'): ?>
                <i class="fas fa-check-circle text-success ms-1" style="font-size: 1rem;" title="Aktif"></i>
            <?php endif; ?>
         <?php $__env->endSlot(); ?>

         <?php $__env->slot('subtitle', null, []); ?> 
            <span class="sb <?php echo e($supplier->status); ?> inline-editable" data-id="<?php echo e($supplier->id); ?>" data-url="/agency/suppliers/<?php echo e($supplier->id); ?>/update-field" data-field="status" data-type="select" data-options="<?php echo e(json_encode($statusOptions)); ?>" data-value="<?php echo e($supplier->status); ?>">
                <?php echo e($supplier->status_label); ?>

            </span>
            <span class="text-muted small fw-500">ID: #SUP-<?php echo e($supplier->id); ?></span>
            <span class="badge bg-primary-soft text-primary border-0 px-2"><?php echo e($supplier->supplier_type_label); ?></span>
         <?php $__env->endSlot(); ?>

         <?php $__env->slot('metrics', null, []); ?> 
            <div class="qv-metric">
                <span class="qv-metric-label">HİZMET YAPISI</span>
                <span class="qv-metric-val"><?php echo e($supplier->type === 'corporate' ? '🏢 Kurumsal' : '👤 Bireysel'); ?></span>
            </div>
            <div class="qv-metric">
                <span class="qv-metric-label">FİYAT LİSTELERİ</span>
                <span class="qv-metric-val text-success"><?php echo e($supplier->priceLists->count()); ?> Sezon</span>
            </div>
            <div class="qv-metric">
                <span class="qv-metric-label">SORUMLU YETKİLİ</span>
                <span class="qv-metric-val text-primary" style="font-size: 0.95rem;"><?php echo e($supplier->responsible_person_name ?: '—'); ?></span>
            </div>
         <?php $__env->endSlot(); ?>

         <?php $__env->slot('tabs', null, []); ?> 
            <?php if (isset($component)) { $__componentOriginal7a160e0e89328e649a5d556167387bab = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal7a160e0e89328e649a5d556167387bab = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.quick-view.tab','data' => ['id' => 'overview','label' => 'Özet & İletişim','icon' => 'fas fa-bolt-lightning','active' => 'true']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('quick-view.tab'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['id' => 'overview','label' => 'Özet & İletişim','icon' => 'fas fa-bolt-lightning','active' => 'true']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal7a160e0e89328e649a5d556167387bab)): ?>
<?php $attributes = $__attributesOriginal7a160e0e89328e649a5d556167387bab; ?>
<?php unset($__attributesOriginal7a160e0e89328e649a5d556167387bab); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal7a160e0e89328e649a5d556167387bab)): ?>
<?php $component = $__componentOriginal7a160e0e89328e649a5d556167387bab; ?>
<?php unset($__componentOriginal7a160e0e89328e649a5d556167387bab); ?>
<?php endif; ?>
            <?php if (isset($component)) { $__componentOriginal7a160e0e89328e649a5d556167387bab = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal7a160e0e89328e649a5d556167387bab = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.quick-view.tab','data' => ['id' => 'prices','label' => 'Fiyat Listeleri','icon' => 'fas fa-money-bill-trend-up']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('quick-view.tab'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['id' => 'prices','label' => 'Fiyat Listeleri','icon' => 'fas fa-money-bill-trend-up']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal7a160e0e89328e649a5d556167387bab)): ?>
<?php $attributes = $__attributesOriginal7a160e0e89328e649a5d556167387bab; ?>
<?php unset($__attributesOriginal7a160e0e89328e649a5d556167387bab); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal7a160e0e89328e649a5d556167387bab)): ?>
<?php $component = $__componentOriginal7a160e0e89328e649a5d556167387bab; ?>
<?php unset($__componentOriginal7a160e0e89328e649a5d556167387bab); ?>
<?php endif; ?>
            <?php if (isset($component)) { $__componentOriginal7a160e0e89328e649a5d556167387bab = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal7a160e0e89328e649a5d556167387bab = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.quick-view.tab','data' => ['id' => 'details','label' => 'Firma & Fatura Bilgileri','icon' => 'fas fa-file-invoice']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('quick-view.tab'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['id' => 'details','label' => 'Firma & Fatura Bilgileri','icon' => 'fas fa-file-invoice']); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal7a160e0e89328e649a5d556167387bab)): ?>
<?php $attributes = $__attributesOriginal7a160e0e89328e649a5d556167387bab; ?>
<?php unset($__attributesOriginal7a160e0e89328e649a5d556167387bab); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal7a160e0e89328e649a5d556167387bab)): ?>
<?php $component = $__componentOriginal7a160e0e89328e649a5d556167387bab; ?>
<?php unset($__componentOriginal7a160e0e89328e649a5d556167387bab); ?>
<?php endif; ?>
         <?php $__env->endSlot(); ?>
     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginala42916bd54053bb95821e6cf6446ae2c)): ?>
<?php $attributes = $__attributesOriginala42916bd54053bb95821e6cf6446ae2c; ?>
<?php unset($__attributesOriginala42916bd54053bb95821e6cf6446ae2c); ?>
<?php endif; ?>
<?php if (isset($__componentOriginala42916bd54053bb95821e6cf6446ae2c)): ?>
<?php $component = $__componentOriginala42916bd54053bb95821e6cf6446ae2c; ?>
<?php unset($__componentOriginala42916bd54053bb95821e6cf6446ae2c); ?>
<?php endif; ?>

    <!-- ─── CONTENT ─── -->
    <?php if (isset($component)) { $__componentOriginal35806a9d22165045bbdc1bc197c3b156 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal35806a9d22165045bbdc1bc197c3b156 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.quick-view.content','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('quick-view.content'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
        
        <!-- ============================================ -->
        <!-- TAB 1: OVERVIEW & TIMELINE -->
        <!-- ============================================ -->
        <div id="qv-tab-overview" class="qv-tab-panel active">
            <?php if (isset($component)) { $__componentOriginal0b5c730a957d61f80b0044e786216866 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal0b5c730a957d61f80b0044e786216866 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.quick-view.main','data' => ['class' => 'border-0']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('quick-view.main'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'border-0']); ?>
                <div class="row g-4">
                    <div class="col-md-7">
                        <!-- Activity Composer -->
                        <div class="qv-activity-editor-card shadow-sm border-0 mb-4" style="background: #fff; border-radius: 20px;">
                            <form id="qv-supplier-activity-form" method="POST" action="<?php echo e(route('agency.suppliers.activities.store', $supplier)); ?>">
                                <?php echo csrf_field(); ?>
                                <input type="hidden" name="activity_type" id="qv-activity-type" value="note">
                                <div class="qv-editor-header border-bottom-0 p-2 overflow-x-auto d-flex flex-nowrap hide-scrollbar">
                                    <div class="qv-editor-tab active flex-shrink-0" onclick="setSupplierActivityType('note', this)"><i class="fas fa-sticky-note me-2 text-warning"></i>Not</div>
                                    <div class="qv-editor-tab flex-shrink-0" onclick="setSupplierActivityType('call', this)"><i class="fas fa-phone me-2 text-primary"></i>Arama</div>
                                    <div class="qv-editor-tab flex-shrink-0" onclick="setSupplierActivityType('whatsapp', this)"><i class="fab fa-whatsapp me-2 text-success"></i>WhatsApp</div>
                                    <div class="qv-editor-tab flex-shrink-0" onclick="setSupplierActivityType('email', this)"><i class="fas fa-envelope me-2 text-info"></i>E-posta</div>
                                    <div class="qv-editor-tab flex-shrink-0" onclick="setSupplierActivityType('meeting', this)"><i class="fas fa-calendar me-2 text-danger"></i>Toplantı</div>
                                </div>
                                <div class="qv-editor-content p-4 pt-0">
                                    <div class="qv-editor-input-wrap mb-3 p-3" style="background: #f8fafc; border-radius: 16px; border: 1px dashed #e2e8f0;">
                                        <input type="text" name="subject" class="qv-editor-subject w-100 border-0 bg-transparent mb-2 fw-700" placeholder="Aktivite Konusu (örn: Fiyat Anlaşması)..." style="outline: none; font-size: 1rem;" required>
                                        <textarea name="description" class="qv-editor-textarea w-100 border-0 bg-transparent" placeholder="Neler yaşandı? Detayları buraya yazın..." required style="outline: none; min-height: 80px; resize: none; font-size: 0.85rem;"></textarea>
                                    </div>
                                    <div class="d-flex align-items-center justify-content-between">
                                        <select name="priority" class="form-select form-select-sm" style="width: 140px; border-radius: 8px;">
                                            <option value="normal">Normal Öncelik</option>
                                            <option value="low">Düşük Öncelik</option>
                                            <option value="high">Yüksek Öncelik</option>
                                            <option value="urgent">🚨 Acil</option>
                                        </select>
                                        <button type="submit" class="btn btn-primary px-4 py-2 fw-700" style="border-radius: 10px; font-size: 0.85rem">
                                            Kaydet <i class="fas fa-paper-plane ms-2"></i>
                                        </button>
                                    </div>
                                </div>
                            </form>
                        </div>

                        <!-- Timeline -->
                        <div class="qv-timeline-container px-2">
                            <h6 class="fw-800 text-dark mb-4 d-flex align-items-center gap-2" style="font-size: 1rem;">
                                <i class="fas fa-history text-primary"></i> ETKİNLİK AKIŞI
                            </h6>
                            <div class="qv-timeline-v2">
                                <?php $__empty_1 = true; $__currentLoopData = $recentActivities; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $activity): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <div class="qv-activity-item mb-3 p-3 shadow-none" style="background:#f8fafc; border-radius: 14px; border: 1px solid #f1f5f9; position: relative;">
                                        <div class="d-flex justify-content-between mb-2">
                                            <span class="badge bg-light text-dark" style="font-size: 0.7rem; font-weight: 700">
                                                <i class="fas <?php echo e($activity->activity_type_icon); ?> me-1"></i> <?php echo e(strtoupper($activity->activity_type_label)); ?>

                                            </span>
                                            <span class="text-muted" style="font-size: 0.72rem"><i class="fas fa-clock me-1"></i><?php echo e($activity->activity_date->diffForHumans()); ?></span>
                                        </div>
                                        <h6 class="fw-700 text-dark mb-1" style="font-size: 0.85rem"><?php echo e($activity->subject); ?></h6>
                                        <p class="text-muted mb-2" style="font-size: 0.8rem; line-height: 1.4"><?php echo e($activity->description); ?></p>
                                        <div class="d-flex align-items-center justify-content-between pt-2 border-top" style="font-size: 0.72rem">
                                            <span class="text-muted"><i class="fas fa-user-circle me-1"></i> <?php echo e($activity->performedBy?->full_name ?: 'Sistem'); ?></span>
                                            <button class="btn btn-link text-danger p-0" onclick="deleteSupplierActivity(<?php echo e($activity->id); ?>)" title="Aktiviteyi Sil"><i class="fas fa-trash"></i></button>
                                        </div>
                                    </div>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <div class="text-center py-4 bg-light border" style="border-radius:14px; border-style:dashed !important">
                                        <i class="fas fa-ghost text-muted mb-2" style="font-size: 2rem"></i>
                                        <p class="text-muted smaller mb-0">Henüz etkinlik kaydedilmemiş.</p>
                                    </div>
                                <?php endif; ?>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-5">
                        <!-- Contact Card -->
                        <div class="card border-0 bg-light p-4 mb-4" style="border-radius: 20px;">
                            <h6 class="fw-800 text-dark mb-3"><i class="fas fa-id-card text-primary me-2"></i>İletişim & Konum</h6>
                            
                            <div class="mb-3">
                                <label class="text-muted small fw-600">BİRİNCİL TELEFON</label>
                                <div class="fw-700 inline-editable" data-id="<?php echo e($supplier->id); ?>" data-url="/agency/suppliers/<?php echo e($supplier->id); ?>/update-field" data-field="phone"><?php echo e($supplier->phone ?: '—'); ?></div>
                            </div>

                            <?php if($supplier->emails && count($supplier->emails) > 0): ?>
                                <div class="mb-3">
                                    <label class="text-muted small fw-600">E-POSTA ADRESLERİ</label>
                                    <?php $__currentLoopData = $supplier->emails; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $email): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <div class="fw-700"><i class="fas fa-envelope text-muted me-2"></i><?php echo e($email); ?></div>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </div>
                            <?php endif; ?>

                            <?php if($supplier->phones && count($supplier->phones) > 0): ?>
                                <div class="mb-3">
                                    <label class="text-muted small fw-600">DİĞER TELEFONLAR</label>
                                    <?php $__currentLoopData = $supplier->phones; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ph): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <div class="fw-700"><i class="fas fa-phone text-muted me-2"></i><?php echo e($ph); ?></div>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </div>
                            <?php endif; ?>

                            <div class="mb-3">
                                <label class="text-muted small fw-600">LOKASYON BİLGİSİ</label>
                                <div class="fw-700"><i class="fas fa-map-marker-alt text-danger me-2"></i><?php echo e($supplier->city ?: '—'); ?><?php if($supplier->district): ?>, <?php echo e($supplier->district); ?><?php endif; ?></div>
                                <?php if($supplier->address): ?>
                                    <div class="text-muted small mt-1 ps-4"><?php echo e($supplier->address); ?></div>
                                <?php endif; ?>
                            </div>
                        </div>

                        <!-- Notes Card -->
                        <div class="card border-0 bg-light p-4" style="border-radius: 20px;">
                            <h6 class="fw-800 text-dark mb-3"><i class="fas fa-sticky-note text-warning me-2"></i>Dahili Notlar</h6>
                            <div class="inline-editable w-100" data-id="<?php echo e($supplier->id); ?>" data-url="/agency/suppliers/<?php echo e($supplier->id); ?>/update-field" data-field="notes" data-type="textarea"><?php echo e($supplier->notes ?: 'Not eklemek için tıklayın...'); ?></div>
                        </div>
                    </div>
                </div>
             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal0b5c730a957d61f80b0044e786216866)): ?>
<?php $attributes = $__attributesOriginal0b5c730a957d61f80b0044e786216866; ?>
<?php unset($__attributesOriginal0b5c730a957d61f80b0044e786216866); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal0b5c730a957d61f80b0044e786216866)): ?>
<?php $component = $__componentOriginal0b5c730a957d61f80b0044e786216866; ?>
<?php unset($__componentOriginal0b5c730a957d61f80b0044e786216866); ?>
<?php endif; ?>
        </div>

        <!-- ============================================ -->
        <!-- TAB 2: PRICING SEASONS & ITEMS -->
        <!-- ============================================ -->
        <div id="qv-tab-prices" class="qv-tab-panel" style="display:none">
            <?php if (isset($component)) { $__componentOriginal0b5c730a957d61f80b0044e786216866 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal0b5c730a957d61f80b0044e786216866 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.quick-view.main','data' => ['class' => 'border-0']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('quick-view.main'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'border-0']); ?>
                <div class="row g-4">
                    <div class="col-md-4">
                        <!-- Add Price List Season -->
                        <div class="card border p-4 mb-4" style="border-radius: 16px; background:#fafbff">
                            <h6 class="fw-800 text-dark mb-3"><i class="fas fa-plus me-2 text-primary"></i>Yeni Fiyat Sezonu</h6>
                            <form id="qv-add-price-list-form" method="POST" action="<?php echo e(route('agency.suppliers.price-lists.store', $supplier)); ?>">
                                <?php echo csrf_field(); ?>
                                <div class="field-group">
                                    <label class="field-label">Sezon/Liste Adı</label>
                                    <input type="text" name="name" class="field-input" placeholder="Yaz Sezonu 2026" required>
                                </div>
                                <div class="fg-2">
                                    <div class="field-group">
                                        <label class="field-label">Başlangıç</label>
                                        <input type="date" name="season_start" class="field-input" required>
                                    </div>
                                    <div class="field-group">
                                        <label class="field-label">Bitiş</label>
                                        <input type="date" name="season_end" class="field-input" required>
                                    </div>
                                </div>
                                <div class="field-group">
                                    <label class="field-label">Para Birimi</label>
                                    <select name="currency" class="field-input">
                                        <option value="TRY">TRY (₺)</option>
                                        <option value="USD">USD ($)</option>
                                        <option value="EUR">EUR (€)</option>
                                    </select>
                                </div>
                                <button type="submit" class="btn btn-primary w-100 py-2 mt-2" style="border-radius: 10px;"><i class="fas fa-check me-2"></i>Sezonu Kaydet</button>
                            </form>
                        </div>
                    </div>

                    <div class="col-md-8">
                        <?php $__empty_1 = true; $__currentLoopData = $supplier->priceLists; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <div class="card border p-4 mb-4" style="border-radius: 20px;">
                                <div class="d-flex justify-content-between align-items-center mb-3">
                                    <div>
                                        <h5 class="fw-800 text-dark mb-1"><?php echo e($list->name); ?></h5>
                                        <span class="text-muted small fw-600"><i class="fas fa-calendar-alt me-1"></i><?php echo e($list->season_start->format('d.m.Y')); ?> - <?php echo e($list->season_end->format('d.m.Y')); ?></span>
                                        <span class="badge bg-light text-primary border px-2 py-1 ms-2" style="font-size:0.75rem; font-weight:700"><?php echo e($list->currency); ?></span>
                                    </div>
                                    <button class="btn btn-sm btn-outline-danger" onclick="deletePriceList(<?php echo e($list->id); ?>)" title="Sezonu Sil"><i class="fas fa-trash-can"></i></button>
                                </div>

                                <!-- Pricing Grid / Items Table -->
                                <div class="table-responsive mb-4 border rounded-12 overflow-hidden">
                                    <table class="table table-sm table-striped align-middle mb-0" style="font-size:0.82rem">
                                        <thead class="table-light fw-700">
                                            <tr>
                                                <th>Fiyat Satırı / Detay</th>
                                                <th>Net Maliyet</th>
                                                <th>Satış Fiyatı</th>
                                                <th style="width:60px">Vergi</th>
                                                <th style="width:50px">Sil</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php $__empty_2 = true; $__currentLoopData = $list->items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_2 = false; ?>
                                                <tr>
                                                    <td>
                                                        <div class="fw-700 text-dark"><?php echo e($item->title); ?></div>
                                                        <?php if($supplier->supplier_type === 'hotel' && !empty($item->metadata)): ?>
                                                            <div class="text-muted smaller">
                                                                <span class="me-2">Pansiyon: <?php echo e($item->metadata['board_type']); ?></span>
                                                                <span class="me-2">Pazar: <?php echo e(ucfirst($item->metadata['market'])); ?></span>
                                                                <?php if(!empty($item->metadata['hb_diff'])): ?>
                                                                    <span>HB Farkı: <?php echo e(number_format($item->metadata['hb_diff'], 2)); ?> <?php echo e($list->currency); ?></span>
                                                                <?php endif; ?>
                                                            </div>
                                                        <?php endif; ?>
                                                    </td>
                                                    <td class="fw-700 text-dark"><?php echo e(number_format($item->net_price, 2)); ?> <?php echo e($list->currency); ?></td>
                                                    <td class="fw-700 text-primary"><?php echo e(number_format($item->sale_price, 2)); ?> <?php echo e($list->currency); ?></td>
                                                    <td>%<?php echo e($item->tax_rate); ?></td>
                                                    <td>
                                                        <button class="btn btn-link text-danger p-0" onclick="deletePriceItem(<?php echo e($item->id); ?>)"><i class="fas fa-times-circle"></i></button>
                                                    </td>
                                                </tr>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_2): ?>
                                                <tr>
                                                    <td colspan="5" class="text-center py-3 text-muted">Bu sezon için henüz fiyat eklenmemiş.</td>
                                                </tr>
                                            <?php endif; ?>
                                        </tbody>
                                    </table>
                                </div>

                                <!-- Add Dynamic Pricing Item -->
                                <div class="p-3 border rounded-12 bg-light">
                                    <h6 class="fw-800 text-dark mb-3"><i class="fas fa-coins me-2 text-primary"></i>Fiyat Ekle</h6>
                                    <form class="qv-add-price-item-form" method="POST" action="<?php echo e(route('agency.suppliers.price-lists.items.store', $list)); ?>">
                                        <?php echo csrf_field(); ?>
                                        
                                        <!-- Dynamic inputs per supplier_type -->
                                        <?php if($supplier->supplier_type === 'hotel'): ?>
                                            <div class="row g-2 mb-2">
                                                <div class="col-md-3">
                                                    <label class="small text-muted fw-600">ODA TİPİ</label>
                                                    <select name="room_type" class="form-select form-select-sm">
                                                        <option value="single">Single Room</option>
                                                        <option value="double">Double Room</option>
                                                        <option value="triple">Triple Room</option>
                                                        <option value="child_0_6">0-6 Yaş Çocuk</option>
                                                        <option value="child_0_12">0-12 Yaş Çocuk</option>
                                                    </select>
                                                </div>
                                                <div class="col-md-3">
                                                    <label class="small text-muted fw-600">PANSİYON</label>
                                                    <select name="board_type" class="form-select form-select-sm">
                                                        <option value="BB">BB (Oda Kahvaltı)</option>
                                                        <option value="HB">HB (Yarım Pansiyon)</option>
                                                        <option value="FB">FB (Tam Pansiyon)</option>
                                                        <option value="UHD">UHD (Ultra Her Şey Dahil)</option>
                                                        <option value="RO">RO (Sadece Oda)</option>
                                                    </select>
                                                </div>
                                                <div class="col-md-3">
                                                    <label class="small text-muted fw-600">PAZAR</label>
                                                    <select name="market" class="form-select form-select-sm">
                                                        <option value="hepsi">Yerli & Yabancı</option>
                                                        <option value="yerli">Yerli</option>
                                                        <option value="yabanci">Yabancı</option>
                                                    </select>
                                                </div>
                                                <div class="col-md-3">
                                                    <label class="small text-muted fw-600">ÜCRET TİPİ</label>
                                                    <select name="price_type" class="form-select form-select-sm">
                                                        <option value="fit">FIT Net</option>
                                                        <option value="grup">GRUP Net</option>
                                                        <option value="fit_grup">Grup ve FIT Net</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="row g-2 mb-3">
                                                <div class="col-md-4">
                                                    <label class="small text-muted fw-600">HB FARKI</label>
                                                    <input type="number" step="0.01" name="hb_diff" value="0.00" class="form-control form-control-sm">
                                                </div>
                                            </div>
                                        <?php elseif($supplier->supplier_type === 'transportation'): ?>
                                            <div class="row g-2 mb-2">
                                                <div class="col-md-3">
                                                    <label class="small text-muted fw-600">NEREDEN</label>
                                                    <input type="text" name="from_location" class="form-control form-control-sm" required placeholder="Havalimanı">
                                                </div>
                                                <div class="col-md-3">
                                                    <label class="small text-muted fw-600">NEREYE</label>
                                                    <input type="text" name="to_location" class="form-control form-control-sm" required placeholder="Otel">
                                                </div>
                                                <div class="col-md-3">
                                                    <label class="small text-muted fw-600">ARAÇ TİPİ</label>
                                                    <input type="text" name="vehicle_type" class="form-control form-control-sm" required placeholder="Mercedes Vito">
                                                </div>
                                                <div class="col-md-3">
                                                    <label class="small text-muted fw-600">YÖN</label>
                                                    <select name="one_way" class="form-select form-select-sm">
                                                        <option value="1">Tek Yön</option>
                                                        <option value="0">Gidiş-Dönüş</option>
                                                    </select>
                                                </div>
                                            </div>
                                        <?php elseif($supplier->supplier_type === 'restaurant'): ?>
                                            <div class="row g-2 mb-2">
                                                <div class="col-md-6">
                                                    <label class="small text-muted fw-600">MENÜ ADI / DETAYI</label>
                                                    <input type="text" name="menu_name" class="form-control form-control-sm" required placeholder="Fix Kebap Menüsü">
                                                </div>
                                                <div class="col-md-6">
                                                    <label class="small text-muted fw-600">İÇECEK DURUMU</label>
                                                    <select name="beverage_included" class="form-select form-select-sm">
                                                        <option value="1">İçecek Dahil</option>
                                                        <option value="0">İçecek Hariç</option>
                                                    </select>
                                                </div>
                                            </div>
                                        <?php elseif($supplier->supplier_type === 'insurance'): ?>
                                            <div class="row g-2 mb-2">
                                                <div class="col-md-4">
                                                    <label class="small text-muted fw-600">POLİÇE KAPSAMI</label>
                                                    <input type="text" name="policy_name" class="form-control form-control-sm" required placeholder="Euro Schengen">
                                                </div>
                                                <div class="col-md-4">
                                                    <label class="small text-muted fw-600">GÜN SÜRESİ</label>
                                                    <input type="number" name="duration_days" class="form-control form-control-sm" required min="1" placeholder="15">
                                                </div>
                                                <div class="col-md-4">
                                                    <label class="small text-muted fw-600">MAX YAŞ LİMİTİ</label>
                                                    <input type="number" name="age_limit" class="form-control form-control-sm" placeholder="65">
                                                </div>
                                            </div>
                                        <?php elseif($supplier->supplier_type === 'visa'): ?>
                                            <div class="row g-2 mb-2">
                                                <div class="col-md-6">
                                                    <label class="small text-muted fw-600">VİZE TÜRÜ</label>
                                                    <input type="text" name="visa_type" class="form-control form-control-sm" required placeholder="Turistik Vize">
                                                </div>
                                                <div class="col-md-6">
                                                    <label class="small text-muted fw-600">ÜLKE KODU (ISO)</label>
                                                    <input type="text" name="country" class="form-control form-control-sm" required maxlength="2" placeholder="FR">
                                                </div>
                                            </div>
                                        <?php elseif($supplier->supplier_type === 'airline'): ?>
                                            <div class="row g-2 mb-2">
                                                <div class="col-md-6">
                                                    <label class="small text-muted fw-600">UÇUŞ PARKURU</label>
                                                    <input type="text" name="route" class="form-control form-control-sm" required placeholder="IST-CDG">
                                                </div>
                                                <div class="col-md-6">
                                                    <label class="small text-muted fw-600">BİLET SINIFI</label>
                                                    <input type="text" name="flight_class" class="form-control form-control-sm" required placeholder="Economy (Y)">
                                                </div>
                                            </div>
                                        <?php endif; ?>

                                        <div class="row g-2">
                                            <div class="col-md-4">
                                                <label class="small text-muted fw-600">NET ALIM MALİYETİ</label>
                                                <input type="number" step="0.01" name="net_price" class="form-control form-control-sm" required placeholder="0.00">
                                            </div>
                                            <div class="col-md-4">
                                                <label class="small text-muted fw-600">SATIŞ FİYATI</label>
                                                <input type="number" step="0.01" name="sale_price" class="form-control form-control-sm" required placeholder="0.00">
                                            </div>
                                            <div class="col-md-2">
                                                <label class="small text-muted fw-600">KDV ORANI %</label>
                                                <input type="number" step="0.1" name="tax_rate" class="form-control form-control-sm" required value="20.0">
                                            </div>
                                            <div class="col-md-2 d-flex align-items-end">
                                                <button type="submit" class="btn btn-dark btn-sm w-100 py-2"><i class="fas fa-plus me-1"></i>Ekle</button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <div class="text-center py-5 bg-light" style="border-radius:24px; border:2px dashed #cbd5e1">
                                <i class="fas fa-money-bill-wave text-muted mb-3" style="font-size: 3rem"></i>
                                <h6 class="fw-800">Henüz Fiyat Sezonu Eklenmemiş</h6>
                                <p class="text-muted small">Sol taraftaki panelden yeni bir fiyat sezonu tanımlayarak fiyatları girmeye başlayın.</p>
                            </div>
                        <?php endif; ?>
                    </div>
                </div>
             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal0b5c730a957d61f80b0044e786216866)): ?>
<?php $attributes = $__attributesOriginal0b5c730a957d61f80b0044e786216866; ?>
<?php unset($__attributesOriginal0b5c730a957d61f80b0044e786216866); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal0b5c730a957d61f80b0044e786216866)): ?>
<?php $component = $__componentOriginal0b5c730a957d61f80b0044e786216866; ?>
<?php unset($__componentOriginal0b5c730a957d61f80b0044e786216866); ?>
<?php endif; ?>
        </div>

        <!-- ============================================ -->
        <!-- TAB 3: COMPANY & BILLING DETAILS FORM -->
        <!-- ============================================ -->
        <div id="qv-tab-details" class="qv-tab-panel" style="display:none">
            <?php if (isset($component)) { $__componentOriginal0b5c730a957d61f80b0044e786216866 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal0b5c730a957d61f80b0044e786216866 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.quick-view.main','data' => ['class' => 'border-0']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('quick-view.main'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'border-0']); ?>
                <form id="qv-supplier-full-edit-form" method="POST" action="<?php echo e(route('agency.suppliers.update', $supplier)); ?>">
                    <?php echo csrf_field(); ?>
                    <?php echo method_field('PUT'); ?>
                    
                    <div class="row g-4">
                        <div class="col-md-6">
                            <!-- Genel Bilgiler Kartı -->
                            <div class="card border p-4 shadow-none" style="border-radius:20px; background:#fff">
                                <h5 class="fw-800 text-dark mb-4 border-bottom pb-2"><i class="fas fa-id-card text-primary me-2"></i>Profil Bilgileri</h5>
                                
                                <input type="hidden" name="type" id="qv-edit-type" value="<?php echo e($supplier->type); ?>">
                                <input type="hidden" name="supplier_type" value="<?php echo e($supplier->supplier_type); ?>">
                                <input type="hidden" name="status" value="<?php echo e($supplier->status); ?>">

                                <?php if($supplier->type === 'individual'): ?>
                                    <div class="fg-2">
                                        <div class="field-group">
                                            <label class="field-label">AD<span class="req">*</span></label>
                                            <input type="text" name="first_name" value="<?php echo e($supplier->first_name); ?>" class="field-input" required>
                                        </div>
                                        <div class="field-group">
                                            <label class="field-label">SOYAD<span class="req">*</span></label>
                                            <input type="text" name="last_name" value="<?php echo e($supplier->last_name); ?>" class="field-input" required>
                                        </div>
                                    </div>
                                <?php else: ?>
                                    <div class="field-group">
                                        <label class="field-label">FİRMA ADI<span class="req">*</span></label>
                                        <input type="text" name="company_name" value="<?php echo e($supplier->company_name); ?>" class="field-input" required>
                                    </div>
                                    <div class="fg-2">
                                        <div class="field-group">
                                            <label class="field-label">VERGİ NO</label>
                                            <input type="text" name="company_tax_number" value="<?php echo e($supplier->company_tax_number); ?>" class="field-input">
                                        </div>
                                        <div class="field-group">
                                            <label class="field-label">VERGİ DAİRESİ</label>
                                            <input type="text" name="company_tax_office" value="<?php echo e($supplier->company_tax_office); ?>" class="field-input">
                                        </div>
                                    </div>
                                <?php endif; ?>

                                <div class="field-group">
                                    <label class="field-label">BİRİNCİL SABİT TELEFON</label>
                                    <input type="text" name="phone" value="<?php echo e($supplier->phone); ?>" class="field-input">
                                </div>
                                <div class="field-group">
                                    <label class="field-label">WEB SİTESİ</label>
                                    <input type="text" name="website" value="<?php echo e($supplier->website); ?>" class="field-input">
                                </div>
                                
                                <div class="field-group mb-0">
                                    <label class="field-label">DAHİLİ NOTLAR</label>
                                    <textarea name="notes" class="field-input" rows="3"><?php echo e($supplier->notes); ?></textarea>
                                </div>
                            </div>
                        </div>

                        <div class="col-md-6">
                            <!-- Sorumlu Yetkili Kartı (Şirketler için) -->
                            <?php if($supplier->type === 'corporate'): ?>
                                <div class="card border p-4 shadow-none mb-4" style="border-radius:20px; background:#fff">
                                    <h5 class="fw-800 text-dark mb-4 border-bottom pb-2"><i class="fas fa-user-tie text-purple me-2"></i>Sorumlu Yetkili</h5>
                                    <div class="field-group">
                                        <label class="field-label">YETKİLİ KİŞİ ADI SOYADI</label>
                                        <input type="text" name="responsible_person_name" value="<?php echo e($supplier->responsible_person_name); ?>" class="field-input">
                                    </div>
                                    <div class="fg-2">
                                        <div class="field-group mb-0">
                                            <label class="field-label">YETKİLİ TELEFON</label>
                                            <input type="text" name="responsible_person_phone" value="<?php echo e($supplier->responsible_person_phone); ?>" class="field-input">
                                        </div>
                                        <div class="field-group mb-0">
                                            <label class="field-label">YETKİLİ E-POSTA</label>
                                            <input type="email" name="responsible_person_email" value="<?php echo e($supplier->responsible_person_email); ?>" class="field-input">
                                        </div>
                                    </div>
                                </div>
                            <?php endif; ?>

                            <!-- Fatura Kartı -->
                            <div class="card border p-4 shadow-none" style="border-radius:20px; background:#fff">
                                <h5 class="fw-800 text-dark mb-4 border-bottom pb-2"><i class="fas fa-file-invoice-dollar text-danger me-2"></i>Fatura Bilgileri</h5>
                                <div class="field-group">
                                    <label class="field-label">FATURA ADRESİ</label>
                                    <textarea name="billing_address" class="field-input" rows="2"><?php echo e($supplier->billing_address); ?></textarea>
                                </div>
                                <div class="fg-3">
                                    <div class="field-group">
                                        <label class="field-label">FATURA ŞEHİR</label>
                                        <input type="text" name="billing_city" value="<?php echo e($supplier->billing_city); ?>" class="field-input">
                                    </div>
                                    <div class="field-group">
                                        <label class="field-label">FATURA İLÇE</label>
                                        <input type="text" name="billing_district" value="<?php echo e($supplier->billing_district); ?>" class="field-input">
                                    </div>
                                    <div class="field-group">
                                        <label class="field-label">FATURA E-POSTA</label>
                                        <input type="email" name="billing_email" value="<?php echo e($supplier->billing_email); ?>" class="field-input">
                                    </div>
                                </div>
                                <div class="fg-2 mt-2 mb-0">
                                    <div class="field-group mb-0">
                                        <label class="field-label">FATURA VERGİ NO</label>
                                        <input type="text" name="billing_tax_number" value="<?php echo e($supplier->billing_tax_number); ?>" class="field-input">
                                    </div>
                                    <div class="field-group mb-0">
                                        <label class="field-label">FATURA VERGİ DAİRESİ</label>
                                        <input type="text" name="billing_tax_office" value="<?php echo e($supplier->billing_tax_office); ?>" class="field-input">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>

                    <!-- Form Footer Buttons -->
                    <div class="d-flex justify-content-end mt-4 pt-3 border-top gap-3">
                        <button type="button" class="btn btn-outline-secondary" onclick="closeQuickView()"><i class="fas fa-times me-2"></i>Vazgeç</button>
                        <button type="submit" class="btn btn-success px-5"><i class="fas fa-save me-2"></i>Tüm Değişiklikleri Kaydet</button>
                    </div>
                </form>
             <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal0b5c730a957d61f80b0044e786216866)): ?>
<?php $attributes = $__attributesOriginal0b5c730a957d61f80b0044e786216866; ?>
<?php unset($__attributesOriginal0b5c730a957d61f80b0044e786216866); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal0b5c730a957d61f80b0044e786216866)): ?>
<?php $component = $__componentOriginal0b5c730a957d61f80b0044e786216866; ?>
<?php unset($__componentOriginal0b5c730a957d61f80b0044e786216866); ?>
<?php endif; ?>
        </div>

     <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal35806a9d22165045bbdc1bc197c3b156)): ?>
<?php $attributes = $__attributesOriginal35806a9d22165045bbdc1bc197c3b156; ?>
<?php unset($__attributesOriginal35806a9d22165045bbdc1bc197c3b156); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal35806a9d22165045bbdc1bc197c3b156)): ?>
<?php $component = $__componentOriginal35806a9d22165045bbdc1bc197c3b156; ?>
<?php unset($__componentOriginal35806a9d22165045bbdc1bc197c3b156); ?>
<?php endif; ?>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalafd3b985888fa2a33a2082f2c35a64dc)): ?>
<?php $attributes = $__attributesOriginalafd3b985888fa2a33a2082f2c35a64dc; ?>
<?php unset($__attributesOriginalafd3b985888fa2a33a2082f2c35a64dc); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalafd3b985888fa2a33a2082f2c35a64dc)): ?>
<?php $component = $__componentOriginalafd3b985888fa2a33a2082f2c35a64dc; ?>
<?php unset($__componentOriginalafd3b985888fa2a33a2082f2c35a64dc); ?>
<?php endif; ?>

<!-- Hidden Delete Forms -->
<form id="qvDeletePriceListForm" method="POST" style="display:none">
    <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
</form>
<form id="qvDeletePriceItemForm" method="POST" style="display:none">
    <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
</form>
<form id="qvDeleteActivityForm" method="POST" style="display:none">
    <?php echo csrf_field(); ?> <?php echo method_field('DELETE'); ?>
</form>

<script>
// Tab Activity Type switcher
function setSupplierActivityType(type, el) {
    document.getElementById('qv-activity-type').value = type;
    el.closest('.qv-editor-header').querySelectorAll('.qv-editor-tab').forEach(t => t.classList.remove('active'));
    el.classList.add('active');
}

// Handle Quick View Activity Form Submission
$(document).off('submit', '#qv-supplier-activity-form').on('submit', '#qv-supplier-activity-form', function(e) {
    e.preventDefault();
    const form = $(this);
    const btn = form.find('button[type="submit"]');
    const originalText = btn.html();
    
    btn.prop('disabled', true).html('<i class="fas fa-spinner fa-spin"></i>');
    const formData = new FormData(this);
    
    $.ajax({
        url: form.attr('action'),
        type: 'POST',
        data: formData,
        processData: false,
        contentType: false,
        headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') },
        success: function(data) {
            if (data.success) {
                if (activeQuickViewUrl) openQuickView(activeQuickViewUrl);
                if (typeof Swal !== 'undefined') {
                    Swal.mixin({
                        toast: true, position: 'top-end', showConfirmButton: false, timer: 2000
                    }).fire({ icon: 'success', title: data.message });
                }
            }
        },
        error: function(xhr) {
            alert('Etkinlik kaydedilirken bir hata oluştu.');
            btn.prop('disabled', false).html(originalText);
        }
    });
});

// Delete Activity
function deleteSupplierActivity(id) {
    if (!confirm('Bu notu/aktiviteyi silmek istediğinizden emin misiniz?')) return;
    
    $.ajax({
        url: `/agency/suppliers/activities/${id}`,
        type: 'DELETE',
        data: { _token: $('meta[name="csrf-token"]').attr('content') },
        success: function(data) {
            if (data.success) {
                if (activeQuickViewUrl) openQuickView(activeQuickViewUrl);
                if (typeof Swal !== 'undefined') {
                    Swal.mixin({
                        toast: true, position: 'top-end', showConfirmButton: false, timer: 2000
                    }).fire({ icon: 'success', title: data.message });
                }
            }
        },
        error: function() {
            alert('Aktivite silinirken bir hata oluştu.');
        }
    });
}

// Add Price Season Form
$(document).off('submit', '#qv-add-price-list-form').on('submit', '#qv-add-price-list-form', function(e) {
    e.preventDefault();
    const form = $(this);
    const btn = form.find('button[type="submit"]');
    const originalText = btn.html();
    
    btn.prop('disabled', true).html('<i class="fas fa-spinner fa-spin"></i>');
    
    $.ajax({
        url: form.attr('action'),
        type: 'POST',
        data: form.serialize(),
        success: function(data) {
            if (data.success) {
                if (activeQuickViewUrl) openQuickView(activeQuickViewUrl, 'prices');
                if (typeof Swal !== 'undefined') {
                    Swal.mixin({
                        toast: true, position: 'top-end', showConfirmButton: false, timer: 2000
                    }).fire({ icon: 'success', title: data.message });
                }
            }
        },
        error: function() {
            alert('Fiyat sezonu eklenirken bir hata oluştu.');
            btn.prop('disabled', false).html(originalText);
        }
    });
});

// Add Price Item
$(document).off('submit', '.qv-add-price-item-form').on('submit', '.qv-add-price-item-form', function(e) {
    e.preventDefault();
    const form = $(this);
    const btn = form.find('button[type="submit"]');
    const originalText = btn.html();
    
    btn.prop('disabled', true).html('<i class="fas fa-spinner fa-spin"></i>');
    
    $.ajax({
        url: form.attr('action'),
        type: 'POST',
        data: form.serialize(),
        success: function(data) {
            if (data.success) {
                if (activeQuickViewUrl) openQuickView(activeQuickViewUrl, 'prices');
                if (typeof Swal !== 'undefined') {
                    Swal.mixin({
                        toast: true, position: 'top-end', showConfirmButton: false, timer: 2000
                    }).fire({ icon: 'success', title: data.message });
                }
            }
        },
        error: function() {
            alert('Fiyat eklenirken bir hata oluştu.');
            btn.prop('disabled', false).html(originalText);
        }
    });
});

// Delete Price Season
function deletePriceList(id) {
    if (!confirm('Bu fiyat sezonunu ve sezon altındaki tüm fiyat satırlarını silmek istediğinizden emin misiniz?')) return;
    
    $.ajax({
        url: `/agency/suppliers/price-lists/${id}`,
        type: 'DELETE',
        data: { _token: $('meta[name="csrf-token"]').attr('content') },
        success: function(data) {
            if (data.success) {
                if (activeQuickViewUrl) openQuickView(activeQuickViewUrl, 'prices');
                if (typeof Swal !== 'undefined') {
                    Swal.mixin({
                        toast: true, position: 'top-end', showConfirmButton: false, timer: 2000
                    }).fire({ icon: 'success', title: data.message });
                }
            }
        },
        error: function() {
            alert('Sezon silinirken bir hata oluştu.');
        }
    });
}

// Delete Price Item
function deletePriceItem(id) {
    if (!confirm('Bu fiyat satırını silmek istediğinizden emin misiniz?')) return;
    
    $.ajax({
        url: `/agency/suppliers/price-items/${id}`,
        type: 'DELETE',
        data: { _token: $('meta[name="csrf-token"]').attr('content') },
        success: function(data) {
            if (data.success) {
                if (activeQuickViewUrl) openQuickView(activeQuickViewUrl, 'prices');
                if (typeof Swal !== 'undefined') {
                    Swal.mixin({
                        toast: true, position: 'top-end', showConfirmButton: false, timer: 2000
                    }).fire({ icon: 'success', title: data.message });
                }
            }
        },
        error: function() {
            alert('Fiyat satırı silinirken bir hata oluştu.');
        }
    });
}
</script>

<style>
    /* Status Badge & General UI */
    .sb { padding: 6px 14px; border-radius: 10px; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; border: 1px solid transparent; }
    .sb.active { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
    .sb.inactive { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
    .sb.blocked { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
    .sb.potential { background: #fef3c7; color: #92400e; border-color: #fde68a; }

    /* Timeline & Composer Styling */
    .qv-activity-editor-card { background: #fff; border-radius: 20px; border: 1px solid #f1f5f9; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.04); }
    .qv-editor-header { display: flex; background: #fafbfc; border-bottom: 1px solid #f1f5f9; padding: 0.5rem; gap: 0.5rem; }
    .qv-editor-tab { 
        padding: 0.6rem 1.25rem; font-size: 0.8rem; font-weight: 700; color: #64748b; 
        border-radius: 12px; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; gap: 0.5rem;
    }
    .qv-editor-tab:hover { background: #f1f5f9; color: #1e293b; }
    .qv-editor-tab.active { background: #fff; color: #2563eb; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

    .qv-editor-subject { width: 100%; border: none; font-size: 1rem; font-weight: 700; outline: none; border-bottom: 1px solid #f1f5f9; padding: 0.5rem 0; margin-bottom: 0.5rem; }
    .qv-editor-textarea { width: 100%; min-height: 80px; border: none; outline: none; font-size: 0.85rem; resize: none; color: #334155; line-height: 1.6; }

    .qv-editor-header::-webkit-scrollbar { display: none; }
    .hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

    .inline-editable { cursor: pointer; border-bottom: 1px dashed #cbd5e1; transition: all 0.2s; display: inline-flex; align-items: center; min-width: 10px; }
    .inline-editable:hover { border-bottom-color: #2563eb; color: #2563eb; background: rgba(37, 99, 235, 0.05); }

    /* Contacts & Note Cards */
    .card.bg-light { background-color: #f8fafc !important; border: 1px solid #f1f5f9 !important; }
    label.text-muted.small.fw-600 {
        font-size: 0.7rem !important;
        font-weight: 700 !important;
        color: #64748b !important;
        letter-spacing: 0.4px;
        margin-bottom: 0.2rem;
    }

    /* Core Form Elements Style System */
    .field-group { margin-bottom: 1.25rem; }
    .field-label {
        display: block; font-size: .78rem; font-weight: 700;
        color: #64748b; text-transform: uppercase; letter-spacing: .4px;
        margin-bottom: .4rem;
    }
    .field-label .req { color: #ef4444; margin-left: 2px; }
    .field-input {
        width: 100%; border: 1.5px solid #e2e8f0; border-radius: 10px;
        padding: .65rem .9rem; font-size: .875rem; color: #0f172a;
        background: #f8fafc; transition: all .2s;
        height: 44px;
    }
    .field-input:focus {
        outline: none; border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37,99,235,.1);
        background: #fff;
    }
    textarea.field-input { height: auto; resize: vertical; }
    select.field-input { cursor: pointer; }

    /* Grid Layouts */
    .fg-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
    .fg-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
    @media(max-width:640px) { .fg-2,.fg-3 { grid-template-columns: 1fr; } }

    /* Pricing Forms & Tables Styling */
    #qv-tab-prices .form-control, 
    #qv-tab-prices .form-select {
        border: 1.5px solid #e2e8f0;
        border-radius: 10px;
        padding: 0.45rem 0.75rem;
        font-size: 0.82rem;
        color: #0f172a;
        background-color: #f8fafc;
        transition: all 0.2s;
        height: 38px;
    }
    #qv-tab-prices .form-control:focus, 
    #qv-tab-prices .form-select:focus {
        outline: none;
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37,99,235,.1);
        background-color: #fff;
    }
    #qv-tab-prices label.small {
        display: block;
        font-size: 0.7rem;
        font-weight: 700;
        color: #64748b;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        margin-bottom: 0.3rem;
    }
    #qv-tab-prices .card {
        border: 1px solid #f1f5f9 !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.02) !important;
        border-radius: 20px !important;
        background: #fff !important;
    }
    .rounded-12 { border-radius: 12px !important; }
    .rounded-16 { border-radius: 16px !important; }
    .rounded-20 { border-radius: 20px !important; }

    /* Buttons Styling */
    .btn-primary {
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        border: none;
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
        font-weight: 600;
        color: #fff !important;
        transition: all 0.2s;
        border-radius: 10px;
    }
    .btn-primary:hover {
        background: linear-gradient(135deg, #1d4ed8, #1e40af);
        box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
        transform: translateY(-1px);
    }
    .btn-dark {
        background: #0f172a;
        border: none;
        border-radius: 10px;
        font-weight: 600;
        transition: all 0.2s;
        color: #fff !important;
    }
    .btn-dark:hover {
        background: #1e293b;
        transform: translateY(-1px);
    }
    .btn-outline-danger {
        border: 1px solid #fee2e2;
        color: #ef4444;
        background: #fff;
        border-radius: 10px;
        transition: all 0.2s;
    }
    .btn-outline-danger:hover {
        background: #ef4444;
        color: #fff;
        border-color: #ef4444;
    }

    /* Tab transitions */
    .qv-tab-panel { animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
    @keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
</style>

<?php /**PATH /home/mehmetguruz/public_html/test/resources/views/agency/suppliers/quick-view.blade.php ENDPATH**/ ?>