/* ============================================================================
   PERSONEL RAPORLARI — "RAPOR SINIFI" GÖRSEL KATMANI  (rpg-*)
   ----------------------------------------------------------------------------
   14.09.2026 örnek raporlarındaki kurumsal rapor dilini uygular:
     · panel başlığı  = ikon + başlık + sağda kapsam rozeti / kontrol
     · KPI ızgarası   = ikon kutusu + etiket + büyük rakam + delta + "Geçen Yıl"
     · sıralı yatay çubuk listesi ("Departman Bazlı ... Top 10")
     · donut yanı yüzdeli lejant listesi
     · B/F/A/LY kolon tonlaması (tablo sütun arka planları)
     · içgörü / uyarı yan panelleri
   Sınıf adları "rpg-" ön ekiyle benzersizdir; bu yüzden ekran seçicisine
   bağlanmaz — Rapor Merkezi'nin kendi gövdesi de, içine gömülen rapor
   bileşenleri (oda/konuk, turnover, mesai) de aynı dili kullanabilsin diye.

   B/F/A/LY renk sözlüğü — UYGULAMANIN HER YERİNDE AYNI:
     Bütçe      #2563eb (mavi)
     Forecast   #f59e0b (amber)
     Gerçekleşen#16a34a (yeşil)
     Geçen Yıl  #94a3b8 (gri)
   Sapma yönü: yeşil = bütçenin altında (lehte), kırmızı = bütçe aşımı (risk).
   ============================================================================ */

:root {
    --rpg-bud: #2563eb;
    --rpg-fc: #f59e0b;
    --rpg-act: #16a34a;
    --rpg-ly: #94a3b8;
    --rpg-bud-bg: #eff6ff;
    --rpg-fc-bg: #fffbeb;
    --rpg-act-bg: #f0fdf4;
    --rpg-ly-bg: #f8fafc;
    --rpg-good: #16a34a;
    --rpg-bad: #dc2626;
    --rpg-ink: #0f172a;
    --rpg-muted: #64748b;
    --rpg-faint: #94a3b8;
    --rpg-line: #e4e8f0;
}

/* ------------------------------------------------------------------ panel -- */
.rpg-panel {
    background: #fff;
    border: 1px solid var(--rpg-line);
    border-radius: 12px;
    padding: 14px 16px 16px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.rpg-head {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 12px;
    min-height: 28px;
}

.rpg-head-icon {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 12px;
}

.rpg-head h6 {
    margin: 0;
    font-size: 14.5px;
    font-weight: 800;
    color: #0f2b5b;
    letter-spacing: -.01em;
}

.rpg-head-note {
    font-size: 11px;
    font-weight: 600;
    color: var(--rpg-faint);
}

/* Sağa yaslanan kapsam rozeti — mockup'taki "Top 10 / Aylık / YTD" kutusu. */
.rpg-head-tag {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 7px;
    padding: 4px 10px;
    white-space: nowrap;
}

.rpg-chart {
    width: 100%;
}

/* -------------------------------------------------------------------- KPI -- */
/* Mockup: 6-8 kart, iki sıra, hiçbiri gizlenmiyor. */
.rpg-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.rpg-kpi {
    background: #fff;
    border: 1px solid var(--rpg-line);
    border-radius: 12px;
    padding: 13px 14px;
    display: flex;
    gap: 11px;
    align-items: flex-start;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
}

.rpg-kpi-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 14px;
    background: #eff6ff;
    color: #2563eb;
}

.rpg-kpi.k-bud .rpg-kpi-icon { background: var(--rpg-bud-bg); color: var(--rpg-bud); }
.rpg-kpi.k-fc  .rpg-kpi-icon { background: var(--rpg-fc-bg);  color: #d97706; }
.rpg-kpi.k-act .rpg-kpi-icon { background: var(--rpg-act-bg); color: var(--rpg-act); }
.rpg-kpi.k-ly  .rpg-kpi-icon { background: var(--rpg-ly-bg);  color: #475569; }
.rpg-kpi.k-risk .rpg-kpi-icon { background: #fef2f2; color: #dc2626; }
.rpg-kpi.k-info .rpg-kpi-icon { background: #f5f3ff; color: #7c3aed; }
.rpg-kpi.k-teal .rpg-kpi-icon { background: #f0fdfa; color: #0d9488; }

.rpg-kpi-body { min-width: 0; flex: 1; }

.rpg-kpi-label {
    margin: 0 0 2px;
    font-size: 11.5px;
    font-weight: 700;
    color: #64748b;
    line-height: 1.25;
}

.rpg-kpi-value {
    margin: 0;
    font-size: 21px;
    font-weight: 800;
    color: var(--rpg-ink);
    letter-spacing: -.03em;
    line-height: 1.15;
    white-space: nowrap;
}

.rpg-kpi-delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 800;
    margin-top: 3px;
}

.rpg-kpi-delta.good { color: var(--rpg-good); }
.rpg-kpi-delta.bad { color: var(--rpg-bad); }
.rpg-kpi-delta.neutral { color: #64748b; }

.rpg-kpi-sub {
    margin: 2px 0 0;
    font-size: 11px;
    color: var(--rpg-faint);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* -------------------------------------------------- sıralı yatay çubuklar -- */
/* "Departman Bazlı Personel Sayısı" paneli: etiket | çubuk | değer            */
.rpg-rank {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 2px;
}

.rpg-rank-row {
    display: grid;
    grid-template-columns: minmax(84px, 34%) 1fr auto;
    align-items: center;
    gap: 8px;
}

.rpg-rank-label {
    font-size: 11.5px;
    color: #475569;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rpg-rank-track {
    height: 13px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
}

.rpg-rank-fill {
    height: 100%;
    background: var(--rpg-bud);
    border-radius: 3px;
    min-width: 2px;
    transition: width .35s ease;
}

.rpg-rank-value {
    font-size: 11.5px;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    min-width: 46px;
    text-align: right;
}

/* Sapma sıralaması: sıfır çizgisinin iki yanına uzanan çubuklar. */
.rpg-div {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rpg-div-row {
    display: grid;
    grid-template-columns: minmax(84px, 30%) 1fr 1fr auto;
    align-items: center;
    gap: 0;
}

.rpg-div-row .rpg-rank-label { grid-column: 1; padding-right: 8px; }

.rpg-div-neg,
.rpg-div-pos {
    height: 13px;
    display: flex;
    background: linear-gradient(90deg, transparent, transparent);
}

.rpg-div-neg { justify-content: flex-end; border-right: 1px solid #cbd5e1; }
.rpg-div-pos { justify-content: flex-start; }

.rpg-div-bar { height: 100%; border-radius: 3px; min-width: 2px; }
.rpg-div-bar.good { background: var(--rpg-good); }
.rpg-div-bar.bad { background: var(--rpg-bad); }

.rpg-div-row .rpg-rank-value { padding-left: 8px; }

/* ------------------------------------------------------ donut + lejant -- */
.rpg-legend {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 4px;
}

.rpg-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.rpg-legend-dot {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
}

.rpg-legend-name {
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rpg-legend-val {
    margin-left: auto;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
}

/* --------------------------------------------- küçük gösterge kutucukları -- */
/* "Oda Başına / Konuk Başına Personel Maliyeti" gibi ikili mini kart alanı.    */
.rpg-minis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

.rpg-mini {
    background: #f8fafc;
    border: 1px solid var(--rpg-line);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.rpg-mini-icon {
    width: 30px;
    height: 30px;
    margin: 0 auto 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 13px;
}

.rpg-mini-label { font-size: 11px; font-weight: 700; color: #64748b; }
.rpg-mini-value { font-size: 19px; font-weight: 800; color: #0f172a; letter-spacing: -.02em; margin-top: 2px; }
.rpg-mini-sub { font-size: 10.5px; color: var(--rpg-faint); font-weight: 600; margin-top: 2px; }

/* -------------------------------------------------- içgörü / uyarı listesi -- */
.rpg-notes { display: flex; flex-direction: column; gap: 10px; }

.rpg-note {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding-bottom: 9px;
    border-bottom: 1px solid #f1f5f9;
}

.rpg-note:last-child { border-bottom: 0; padding-bottom: 0; }

.rpg-note-badge {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    background: #eff6ff;
    color: #2563eb;
}

.rpg-note-badge.good { background: #f0fdf4; color: #16a34a; }
.rpg-note-badge.warn { background: #fffbeb; color: #d97706; }
.rpg-note-badge.bad { background: #fef2f2; color: #dc2626; }

.rpg-note-title { font-size: 12.5px; font-weight: 700; color: #0f172a; line-height: 1.35; }
.rpg-note-text { font-size: 11.5px; color: #64748b; line-height: 1.45; margin-top: 1px; }

/* --------------------------------------------------- senaryo künye listesi -- */
.rpg-facts { display: flex; flex-direction: column; }

.rpg-fact {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dashed #eef2f7;
    font-size: 12px;
}

.rpg-fact:last-child { border-bottom: 0; }
.rpg-fact-k { color: #64748b; font-weight: 600; }
.rpg-fact-v { font-weight: 800; color: #0f172a; text-align: right; }
.rpg-fact-v.bud { color: var(--rpg-bud); }
.rpg-fact-v.fc { color: #d97706; }
.rpg-fact-v.act { color: var(--rpg-act); }
.rpg-fact-v.ly { color: #475569; }

/* ===========================================================================
   TABLO — B/F/A/LY SÜTUN TONLAMASI
   Syncfusion grid hücrelerine sınıf CustomAttributes ile verilir; başlık ve
   gövde aynı tonu alır ki sütun tek blok gibi okunsun.
   =========================================================================== */
.rpg-scope .e-grid, .rp-page .e-grid .e-headercell.rpg-c-bud,
.rpg-scope .e-grid, .rp-page .e-grid .rpg-c-bud { background: var(--rpg-bud-bg); }
.rpg-scope .e-grid, .rp-page .e-grid .e-headercell.rpg-c-fc,
.rpg-scope .e-grid, .rp-page .e-grid .rpg-c-fc { background: var(--rpg-fc-bg); }
.rpg-scope .e-grid, .rp-page .e-grid .e-headercell.rpg-c-act,
.rpg-scope .e-grid, .rp-page .e-grid .rpg-c-act { background: var(--rpg-act-bg); }
.rpg-scope .e-grid, .rp-page .e-grid .e-headercell.rpg-c-ly,
.rpg-scope .e-grid, .rp-page .e-grid .rpg-c-ly { background: var(--rpg-ly-bg); }

.rpg-scope .e-grid, .rp-page .e-grid .e-headercell.rpg-c-bud .e-headertext { color: #1d4ed8; }
.rpg-scope .e-grid, .rp-page .e-grid .e-headercell.rpg-c-fc .e-headertext { color: #b45309; }
.rpg-scope .e-grid, .rp-page .e-grid .e-headercell.rpg-c-act .e-headertext { color: #15803d; }
.rpg-scope .e-grid, .rp-page .e-grid .e-headercell.rpg-c-ly .e-headertext { color: #475569; }

/* Sapma hücresi rozetleri */
.rpg-var { font-weight: 800; }
.rpg-var.good { color: var(--rpg-good); }
.rpg-var.bad { color: var(--rpg-bad); }
.rpg-var.flat { color: #64748b; }

.rpg-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.rpg-pill.good { background: #f0fdf4; color: #15803d; }
.rpg-pill.bad { background: #fef2f2; color: #b91c1c; }
.rpg-pill.flat { background: #f1f5f9; color: #475569; }

/* Toplam satırı: mockup'taki koyu, kalın "Genel Toplam". */
.rpg-scope .e-grid, .rp-page .e-grid .e-row.rpg-total-row td,
.rpg-scope .e-grid, .rp-page .e-grid .e-gridfooter .e-summarycell {
    background: #eef4ff !important;
    font-weight: 800 !important;
    color: #0f2b5b !important;
    border-top: 2px solid #c7d8f5 !important;
}

/* ----------------------------------------------------- sezonsallık ısı tablosu */
.rpg-heat { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 11.5px; }
.rpg-heat th { font-weight: 800; color: #475569; padding: 6px 4px; text-align: center; background: #f8fafc; border-radius: 4px; }
.rpg-heat th:first-child, .rpg-heat td:first-child { text-align: left; padding-left: 8px; }
.rpg-heat td { padding: 6px 4px; text-align: center; border-radius: 4px; color: #0f172a; font-weight: 600; }
.rpg-heat tfoot td { background: #eef4ff !important; font-weight: 800; color: #0f2b5b; }

/* ------------------------------------------------------------------ ızgara -- */
.rpg-row { display: grid; gap: 14px; margin-bottom: 14px; }
.rpg-row-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rpg-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rpg-row-8-4 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.rpg-row-5-4-3 { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr); }
.rpg-row-4-4-4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Sıkışma yerine ALTA YIĞ: dar ekranda grafik ezilmez (kullanıcı talebi). */
@media (max-width: 1500px) {
    .rpg-row-5-4-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .rpg-row-5-4-3 > *:last-child { grid-column: 1 / -1; }
}

@media (max-width: 1100px) {
    .rpg-row-2,
    .rpg-row-3,
    .rpg-row-8-4,
    .rpg-row-5-4-3,
    .rpg-row-4-4-4 { grid-template-columns: minmax(0, 1fr); }
    .rpg-row-5-4-3 > *:last-child { grid-column: auto; }
}

/* ------------------------------------------------------------- karanlık tema */
body.dark-mode .rpg-panel,
body.dark-mode .rpg-kpi {
    background: #101a2c;
    border-color: #1f2f4a;
    box-shadow: none;
}

body.dark-mode .rpg-head h6,
body.dark-mode .rpg-kpi-value,
body.dark-mode .rpg-rank-value,
body.dark-mode .rpg-legend-val,
body.dark-mode .rpg-mini-value,
body.dark-mode .rpg-note-title,
body.dark-mode .rpg-fact-v { color: #e2e8f0; }

body.dark-mode .rpg-rank-track { background: #1c2941; }
body.dark-mode .rpg-mini { background: #16233a; border-color: #1f2f4a; }
body.dark-mode .rpg-head-tag { background: #16233a; border-color: #1f2f4a; color: #cbd5e1; }
