/* ═══════════════════════════════════════════════════════════════
   PORTAL ORTAK STİLLER (PortalDataTable + PortalDetayPopup)
   App.razor'a global olarak yüklenir, hem sponsor hem koordinator
   tarafından kullanılır.
   ─────────────────────────────────────────────────────────────── */

/* ═══ PORTAL DATA TABLE TOOLBAR — arama + sayım sağa hizalı ═══ */
.pdt-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: var(--t-hover, #f8fafc);
    border-bottom: 1px solid var(--t-card-border, #e2e8f0);
    flex-wrap: wrap;
}
.pdt-toolbar-spacer { flex: 1; min-width: 0; }
.pdt-toolbar-actions {
    display: flex;
    align-items: stretch;
    gap: 8px;
}
.pdt-search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    height: 36px;
    background: var(--t-card, white);
    border: 1px solid var(--t-card-border, #e2e8f0);
    border-radius: 10px;
    width: 280px;
    max-width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
.pdt-search:focus-within {
    border-color: var(--portal-accent, #3b82f6);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--portal-accent, #3b82f6) 18%, transparent);
}
.pdt-search-ikon { font-size: 0.95rem; opacity: 0.65; }
.pdt-search-input {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: 0.88rem; color: var(--t-text, #0f172a); font-family: inherit;
    padding: 0; height: 100%;
}
.pdt-search-input::placeholder { color: #94a3b8; }
.pdt-search-temizle {
    background: #f1f5f9; border: none; color: #64748b;
    width: 22px; height: 22px; border-radius: 50%;
    cursor: pointer; font-size: 0.7rem; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
}
.pdt-search-temizle:hover { background: #e2e8f0; }
/* Kayıt sayısı rozeti — arama input'u ile aynı yükseklik, gradient tema */
.pdt-info {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    gap: 4px;
    background: linear-gradient(135deg, var(--portal-accent, #3b82f6), var(--portal-accent-2, #6366f1));
    border-radius: 10px;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--portal-accent, #3b82f6) 30%, transparent);
    user-select: none;
    white-space: nowrap;
}
.pdt-count-num { font-weight: 800; }
.pdt-count-sep { opacity: 0.65; font-weight: 500; margin: 0 2px; }
.pdt-count-total { opacity: 0.85; font-weight: 600; }

/* Başlık + arama + sayım — tek satır (İş Girişleri vb.) */
.portal-panel-header.pdt-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 18px 22px;
    border-bottom: 1px solid var(--t-card-border, #e2e8f0);
    background: linear-gradient(180deg, var(--t-hover, #f8fafc), var(--t-card, white));
    box-sizing: border-box;
}
.pdt-panel-head-left {
    flex: 1;
    min-width: 0;
}
.pdt-panel-head-left h3 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--t-text, #0f172a);
}
.pdt-panel-head-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 720px) {
    .pdt-toolbar { padding: 10px 12px; }
    .pdt-toolbar-spacer { display: none; }
    .pdt-toolbar-actions { width: 100%; }
    .pdt-search { width: auto; flex: 1; }
    .pdt-panel-head-right {
        width: 100%;
        justify-content: flex-start;
    }
    .pdt-panel-head-right .pdt-toolbar-actions {
        flex: 1;
        min-width: 0;
    }
}

.pdt-clickable { cursor: pointer; }

/* ═══ TABLO GENİŞLİK & SCROLL — kesin kontrol ═══
   - Sayfa zaten .portal-shell içinde scroll yapıyor (PortalLayout fix)
   - Tablo iç dikey scroll'u kaldırıyoruz → çift-scroll önle, doğal akış
   - Yatay overflow korunur (geniş tablolar için)
   - Genişlik %100 zorla — tablo paneli tamamen doldursun */
.portal-panel {
    width: 100%;
    box-sizing: border-box;
}
.portal-table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    max-height: none;
    -webkit-overflow-scrolling: touch;
}
.portal-table-wrap.pdt-sticky {
    max-height: none;
    overflow-y: visible;
}
.portal-table {
    width: 100% !important;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}
/* Tablonun cell'lerinde yatay sıkışma — uzun metinler kırılsın */
.portal-table td,
.portal-table th {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.portal-cell-bold { font-weight: 700; color: var(--t-text, #0f172a); }
.portal-cell-sub { font-size: 0.74rem; color: var(--t-text-muted, #94a3b8); margin-top: 2px; }

/* ═══ "BU KAPSAM İÇİN HENÜZ KAYIT YOK" — temalı boş durum ═══ */
.portal-mini-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    text-align: center;
    color: var(--portal-accent-text, #475569);
    font-size: 0.95rem;
    font-weight: 600;
    background:
        radial-gradient(ellipse at center, color-mix(in srgb, var(--portal-accent, #6366f1) 6%, transparent) 0%, transparent 70%),
        linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 14px;
    border: 1.5px dashed color-mix(in srgb, var(--portal-accent, #6366f1) 28%, #cbd5e1);
    margin: 8px 14px 14px;
}
.portal-mini-empty::before {
    content: '🗂️';
    font-size: 2.4rem;
    opacity: 0.85;
    display: block;
    line-height: 1;
}
.portal-mini-empty span { display: block; line-height: 1.5; }

/* ═══ DETAY POPUP ═══ */
.pdp-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    animation: pdpFade .18s ease;
}
@keyframes pdpFade { from { opacity: 0; } to { opacity: 1; } }

.pdp-modal {
    background: white;
    border-radius: 18px;
    width: 100%;
    max-width: 620px;
    max-height: 90vh;
    overflow: hidden;
    display: flex; flex-direction: column;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.30);
    animation: pdpSlide .25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes pdpSlide {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.pdp-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, var(--portal-accent, #3b82f6), var(--portal-accent-2, #6366f1));
    color: white;
}
.pdp-title { display: flex; align-items: center; gap: 10px; }
.pdp-ikon { font-size: 1.4rem; }
.pdp-title h3 { margin: 0; font-size: 1.05rem; font-weight: 700; color: white; }
.pdp-close {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    width: 30px; height: 30px;
    border-radius: 8px;
    cursor: pointer; font-size: 1rem;
    transition: background .15s;
}
.pdp-close:hover { background: rgba(255,255,255,0.32); }

.pdp-body {
    padding: 22px;
    overflow-y: auto;
    background: #f8fafc;
}

.pdp-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.pdp-row {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    display: flex; flex-direction: column; gap: 4px;
}
.pdp-row-full { grid-column: 1 / -1; }
.pdp-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 700;
    color: #64748b;
}
.pdp-val { font-size: 0.92rem; color: #0f172a; word-break: break-word; }
.pdp-val-strong { font-weight: 700; font-size: 1rem; }
.pdp-image {
    max-width: 100%;
    max-height: 360px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin-top: 6px;
    display: block;
}
.pdp-file {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 14px;
    background: var(--portal-accent-soft, #eef2ff);
    color: var(--portal-accent-text, #1e3a8a);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600; font-size: 0.88rem;
    margin-top: 6px;
    border: 1px solid color-mix(in srgb, var(--portal-accent, #3b82f6) 25%, transparent);
}
.pdp-file:hover { background: color-mix(in srgb, var(--portal-accent, #3b82f6) 15%, white); }

/* Masraf popup — görsel sağda, detay solda */
.pdp-modal-masraf-gorsel { max-width: 1100px; }
.pdp-modal-merkez-detay { max-width: 720px; }
.pdp-masraf-split {
    display: flex; gap: 22px; align-items: flex-start;
}
.pdp-masraf-detay {
    flex: 1; min-width: 0; overflow-y: auto; max-height: 70vh;
}
.pdp-masraf-gorsel {
    flex: 0 0 420px; display: flex; flex-direction: column; gap: 8px;
    position: sticky; top: 0;
    background: #f1f5f9; border-radius: 12px; padding: 14px;
    border: 1px solid #e2e8f0; max-height: 70vh; overflow: auto;
}
.pdp-masraf-img {
    width: 100%; max-height: 65vh; object-fit: contain;
    border-radius: 10px; border: 1px solid #e2e8f0;
    display: block; cursor: zoom-in;
}

@media (max-width: 800px) {
    .pdp-masraf-split { flex-direction: column; }
    .pdp-masraf-gorsel { flex: none; width: 100%; max-height: 50vh; }
    .pdp-modal-masraf-gorsel { max-width: 100%; }
}

@media (max-width: 600px) {
    .pdp-grid { grid-template-columns: 1fr; }
    .pdp-modal { max-width: 100%; }
}

/* ═══ YÜKLENİYOR DURUMU (her iki portal için) ═══ */
.portal-yukleniyor {
    text-align: center;
    padding: 60px 30px;
    color: #64748b;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.portal-spinner {
    width: 36px; height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--portal-accent, #3b82f6);
    border-radius: 50%;
    animation: portalSpin 0.7s linear infinite;
}
@keyframes portalSpin { to { transform: rotate(360deg); } }
