/* ═══════════════════════════════════════════════════════
   PERSONEL MODÜLÜ — ORTAK LİSTE / TABLO / FİLTRE CSS
   Tüm personel sayfalarında aynı görünümü sağlar.
   IsGirisi, Hastalar, MasrafGirisi, Izinlerim,
   Yetkilendirme, Ekipmanlarim, vb.
   ═══════════════════════════════════════════════════════ */

/* ═══ LİSTE BÖLÜMÜ (section kapsayıcı) ═══ */
.pl-list-section {
    background: var(--t-card, white); border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

/* ═══ LİSTE BAŞLIĞI ═══ */
.pl-list-header {
    padding: 16px 24px; border-bottom: 2px solid var(--t-card-border, #f1f5f9);
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 10px;
    background: linear-gradient(135deg, #f8fafc, #eff6ff);
}

.pl-title-with-icon {
    display: flex; align-items: center; gap: 10px;
}
.pl-title-with-icon .icon { font-size: 1.2rem; }
.pl-title-with-icon h3 {
    margin: 0; font-size: 1rem; font-weight: 800; color: var(--t-text, #1e293b);
}

.pl-count-badge {
    background: rgba(99,102,241,0.1); color: #6366f1;
    padding: 3px 10px; border-radius: 8px;
    font-size: 0.78rem; font-weight: 700; margin-left: 4px;
}

/* Header sağ taraf — search + export birlikte */
.pl-header-actions {
    display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; flex-shrink: 0;
}

/* ═══ EXCEL EXPORT BUTONU ═══ */
.export-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 10px;
    background: linear-gradient(135deg, #059669, #10b981);
    color: white; border: none; font-weight: 700;
    font-size: 0.82rem; cursor: pointer;
    transition: all 0.2s; white-space: nowrap; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}
.export-btn:hover {
    background: linear-gradient(135deg, #047857, #059669);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}
.export-btn:disabled {
    background: #94a3b8; cursor: not-allowed;
    box-shadow: none; transform: none;
}

/* Excel ikon badge */
.xls-icon {
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.25); color: white;
    font-size: 0.62rem; font-weight: 900; letter-spacing: 0.5px;
    padding: 2px 5px; border-radius: 4px; line-height: 1;
    border: 1px solid rgba(255,255,255,0.3);
}

/* Tema desteği */
[data-theme] .export-btn {
    background: linear-gradient(135deg, var(--t-accent, #059669), #10b981);
}

/* ═══ ARAMA ═══ */
.pl-search {
    flex: 0 1 280px; min-width: 180px;
}
.pl-search input {
    width: 100%; padding: 8px 14px;
    border: 1.5px solid var(--t-card-border, #e2e8f0); border-radius: 8px;
    font-size: 0.85rem; outline: none; box-sizing: border-box;
    transition: border 0.2s; background: var(--t-card, white); color: var(--t-text, #334155);
}
.pl-search input:focus {
    border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.08);
}

/* ═══ FİLTRE SATIRI ═══ */
.pl-filter-bar {
    display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px;
    background: linear-gradient(135deg, #fafbff, #f1f5ff); border-bottom: 1px solid var(--t-card-border, #f1f5f9);
}
.pl-filter-btn {
    padding: 7px 16px; border: 1.5px solid var(--t-card-border, #e2e8f0); border-radius: 10px;
    background: var(--t-card, white); font-weight: 700; font-size: 0.82rem; cursor: pointer;
    color: var(--t-text-muted, #64748b); transition: all 0.2s;
}
.pl-filter-btn.active {
    background: #6366f1; color: white; border-color: #6366f1;
}
.pl-filter-btn:hover:not(.active) {
    border-color: #6366f1; color: #6366f1;
}
/* Renkli filtre aktif durumları */
.pl-filter-btn.waiting.active  { background: #dc2626; border-color: #dc2626; }
.pl-filter-btn.arrived.active  { background: #d97706; border-color: #d97706; }
.pl-filter-btn.reported.active { background: #7c3aed; border-color: #7c3aed; }
.pl-filter-btn.approved.active { background: #2563eb; border-color: #2563eb; }
.pl-filter-btn.paid.active     { background: #16a34a; border-color: #16a34a; }

/* ═══ TABLO WRAP ═══ */
.pl-table-wrap { overflow-x: auto; }

/* ═══ TABLO ═══ */
.pl-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.85rem; }
.pl-table thead { background: linear-gradient(135deg, #f8fafc, #f1f5f9); }
.pl-table th {
    padding: 10px 14px; text-align: left; font-weight: 700; color: var(--t-text-muted, #475569);
    border-bottom: 2px solid var(--t-card-border, #e2e8f0); white-space: nowrap;
}
.pl-table th.th-sort { cursor: pointer; user-select: none; transition: color 0.15s; }
.pl-table th.th-sort:hover { color: #6366f1; }
.pl-table .sort-icon { font-size: 0.65rem; opacity: 0.5; margin-left: 2px; }
.pl-table th.th-sort:hover .sort-icon { opacity: 1; }
.pl-table td {
    padding: 10px 14px; border-bottom: 1px solid var(--t-card-border, #f1f5f9); color: var(--t-text, #334155);
}
.pl-table tr:hover { background: var(--t-hover, #fafbfc); cursor: pointer; }
.pl-table .row-active { background: #eff6ff !important; }
.pl-table .row-dim { opacity: 0.55; }

/* ═══ KOLON FİLTRE BAŞLIKLARI ═══ */
.pl-table .th-sf { cursor: pointer; user-select: none; position: relative; transition: all 0.15s; }
.pl-table .th-sf:hover { color: #6366f1; background: #f0f4ff; }
.pl-table .th-sf.filtered { color: #4f46e5; background: #eef2ff; }
.pl-table .th-sf.filterable { border-bottom: 2.5px solid #c7d2fe; }
.pl-table .th-sf.filterable.filtered { border-bottom-color: #6366f1; }

/* ═══ KOLON FİLTRE POPUP — yonetim-liste.css'teki global cfp-* kuralları kullanılır ═══ */

.col-filter-banner {
    display: flex; align-items: center; gap: 12px; padding: 8px 16px; margin-bottom: 8px;
    background: #eef2ff; border: 1.5px solid #c7d2fe; border-radius: 8px;
    font-size: 0.82rem; font-weight: 600; color: #4f46e5;
}
.col-filter-banner button {
    margin-left: auto; border: 1px solid #a5b4fc; background: white; color: #4f46e5;
    padding: 3px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; cursor: pointer;
}
.col-filter-banner button:hover { background: #eef2ff; }

/* ═══ ORTAK TD YARDIMCILARI ═══ */
.pl-table .td-id { font-weight: 700; color: #94a3b8; font-size: 0.78rem; }
.pl-table .td-tutar { font-weight: 700; color: var(--t-text, #1e293b); white-space: nowrap; }
.pl-table .td-desc { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--t-text-muted, #64748b); }
.pl-table .td-center { text-align: center; }
.pl-table .td-bold { font-weight: 700; }
.pl-table .td-muted { color: #cbd5e1; }
.pl-table .empty-row {
    text-align: center;
    padding: 40px 16px !important;
    color: #dc2626;
    font-size: 0.92rem;
    font-weight: 600;
    background: linear-gradient(135deg, #fef2f2, #fff5f5) !important;
}
.pl-table .empty-row .empty-icon {
    display: block;
    font-size: 2.2rem;
    margin-bottom: 8px;
    opacity: 0.7;
}
.pl-table .empty-row .empty-text {
    display: block;
    color: #dc2626;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* ═══ PİLLER (Durum etiketleri) ═══ */
.pl-pill {
    display: inline-block; padding: 4px 12px; border-radius: 8px;
    font-size: 0.76rem; font-weight: 700; white-space: nowrap;
}
.pl-pill.green   { background: #f0fdf4; color: #16a34a; }
.pl-pill.blue    { background: #eff6ff; color: #3b82f6; }
.pl-pill.red     { background: #fef2f2; color: #dc2626; }
.pl-pill.gray    { background: #f1f5f9; color: #64748b; }
.pl-pill.orange  { background: #fff7ed; color: #ea580c; }
.pl-pill.yellow  { background: #fffbeb; color: #d97706; }
.pl-pill.purple  { background: #faf5ff; color: #9333ea; }
.pl-pill.indigo  { background: #eef2ff; color: #6366f1; }
.pl-pill.teal    { background: #f0fdfa; color: #0d9488; }
.pl-pill.cyan    { background: #ecfeff; color: #0891b2; }

/* Tag (hasta no, çalışma kodu vb.) */
.pl-tag {
    background: var(--t-hover, #f1f5f9); padding: 3px 10px; border-radius: 6px;
    font-weight: 600; font-size: 0.82rem; color: var(--t-text-muted, #475569);
}
.pl-tag.code { font-family: monospace; font-weight: 700; color: var(--t-text, #334155); }

/* ═══ RESPONSİVE ═══ */
@media (max-width: 768px) {
    .pl-list-header { padding: 14px 16px; gap: 8px; }
    .pl-title-with-icon h3 { font-size: 0.92rem; }
    .pl-search { flex: 1 1 0; min-width: 120px; }
    .pl-search input { font-size: 0.8rem; padding: 6px 12px; }
    .pl-header-actions { flex: 1 1 100%; min-width: 0; }
    .export-btn { padding: 6px 10px; font-size: 0.75rem; }
    .pl-filter-bar {
        overflow-x: auto; flex-wrap: nowrap; padding: 8px 12px; gap: 6px;
    }
    .pl-filter-btn { flex-shrink: 0; font-size: 0.72rem; padding: 5px 10px; }
    .pl-table th { padding: 10px 12px; font-size: 0.72rem; }
    .pl-table td { padding: 10px 12px; font-size: 0.8rem; }
    .pl-table-wrap .cfp-dropdown { width: min(90vw, 320px); }
}

@media (max-width: 480px) {
    .pl-list-header { flex-direction: column; align-items: stretch; padding: 12px; }
    .pl-header-actions { width: 100%; }
    .pl-search { flex: 1 1 0; min-width: 0; }
    .export-btn { padding: 6px 8px; font-size: 0.72rem; gap: 4px; }
    .pl-filter-btn { font-size: 0.67rem; padding: 4px 7px; }
}
