/* ═══════════════════════════════════════════════════════════════════════
   Nakit Akış Kiti (cfr-*) — Yeni Versiyon ekran kabuğu.
   report-kit.css'in (rk-*) ÜSTÜNE gelir; renk/aralık değişkenleri oradan okunur.
   Eski cashflow-*.css aileleriyle sınıf paylaşmaz.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Modül gezinmesi (cfn-*) — tüm nakit ekranlarının üst şeridi ─────────
   Üst satır: modül · 6 grup · Tüm Raporlar. Alt satır: aktif grubun ekranları.
   Kaynak: CashFlowReportCatalog (Presentation/Components/CashFlow). */
.cfn {
    background: var(--rk-card);
    border: 1px solid var(--rk-line);
    border-radius: var(--rk-radius);
    box-shadow: var(--rk-shadow);
    overflow: hidden;
}
.cfn-pending { min-height: 50px; }
.cfn-top {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 8px 6px 12px;
    min-height: 50px;
}
.cfn-brand {
    display: inline-flex; align-items: center; gap: 9px;
    padding-right: 14px; margin-right: 2px;
    border-right: 1px solid var(--rk-line);
    color: var(--rk-ink); text-decoration: none; white-space: nowrap;
    font-size: .86rem; font-weight: 800; letter-spacing: -.005em;
}
.cfn-brand-icon {
    width: 30px; height: 30px; border-radius: 9px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, #0ea5e9, #1d4ed8); color: #fff; font-size: .8rem;
}
.cfn-brand:hover { color: var(--rk-accent); }
.cfn-groups { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.cfn-groups::-webkit-scrollbar { display: none; }
.cfn-group {
    --g: var(--rk-accent);
    display: inline-flex; align-items: center; gap: 7px;
    height: 36px; padding: 0 12px; border-radius: 9px;
    color: var(--rk-ink-2); text-decoration: none; white-space: nowrap;
    font-size: .79rem; font-weight: 650;
    transition: background .12s, color .12s;
}
.cfn-group i { font-size: .76rem; color: var(--g); opacity: .85; }
.cfn-group:hover { background: #f1f5f9; color: var(--rk-ink); }
.cfn-group.active {
    background: color-mix(in srgb, var(--g) 11%, #fff);
    color: color-mix(in srgb, var(--g) 80%, #0f172a);
    font-weight: 780;
}
.cfn-group.active i { opacity: 1; }
/* İşlemler ve Tanımlar raporlardan ince bir çizgiyle ayrılır */
.cfn-group-ops { color: var(--rk-muted); }
.cfn-group:not(.cfn-group-ops) + .cfn-group-ops { margin-left: 12px; position: relative; }
.cfn-group:not(.cfn-group-ops) + .cfn-group-ops::before {
    content: ""; position: absolute; left: -8px; top: 9px; bottom: 9px; width: 1px; background: var(--rk-line);
}
.cfn-all {
    display: inline-flex; align-items: center; gap: 7px;
    height: 34px; padding: 0 12px; border-radius: 9px;
    border: 1px solid var(--rk-line); background: #fff;
    color: var(--rk-ink); text-decoration: none; white-space: nowrap;
    font-size: .76rem; font-weight: 700;
}
.cfn-all:hover, .cfn-all.active { border-color: #bfdbfe; background: var(--rk-accent-soft); color: var(--rk-accent); }
.cfn-sub {
    --g: var(--rk-accent);
    display: flex; align-items: stretch; gap: 2px;
    padding: 0 10px;
    border-top: 1px solid var(--rk-line-2);
    background: linear-gradient(180deg, #fbfcfe, #f8fafc);
    overflow-x: auto; scrollbar-width: thin;
}
.cfn-tab {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 12px 9px;
    border-bottom: 2px solid transparent;
    color: var(--rk-muted); text-decoration: none; white-space: nowrap;
    font-size: .77rem; font-weight: 650;
    transition: color .12s, border-color .12s;
}
.cfn-tab i { font-size: .72rem; }
.cfn-tab:hover { color: var(--rk-ink); }
.cfn-tab.active { color: var(--rk-ink); border-bottom-color: var(--g); font-weight: 780; }
.cfn-tab.active i { color: var(--g); }
@media (max-width: 1100px) {
    .cfn-brand-text { display: none; }
    .cfn-brand { padding-right: 8px; }
}
@media (max-width: 760px) {
    .cfn-group span, .cfn-all span { display: none; }
    .cfn-group { padding: 0 10px; }
}
/* Eski (cf-/cfm-) işlem ekranlarında şerit sayfa kenarına yapışmasın */
.cf-page > .cfn, .cfm-page > .cfn, .rc > .cfn { margin-bottom: 14px; }

/* ── Başlık satırı (cfr-head) ─────────────────────────────────────────── */
.cfr-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    padding: 4px 2px 0;
}
.cfr-head-main { min-width: 0; flex: 1 1 420px; }
.cfr-head-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cfr-head-title h1 {
    margin: 0; font-size: 1.42rem; font-weight: 800; letter-spacing: -.018em;
    color: var(--rk-ink); line-height: 1.2;
}
.cfr-code {
    padding: 3px 8px; border-radius: 6px;
    background: #eef2f7; color: var(--rk-muted);
    font-size: .62rem; font-weight: 800; letter-spacing: .05em;
}
.cfr-question {
    display: flex; align-items: baseline; gap: 7px;
    margin: 6px 0 0; font-size: .86rem; color: var(--rk-ink-2); font-weight: 550;
}
.cfr-question i { color: var(--rk-accent); font-size: .78rem; flex: none; }
.cfr-method { margin: 3px 0 0; font-size: .74rem; color: var(--rk-muted); }
.cfr-method b { color: var(--rk-ink-2); }
.cfr-print-scope { display: none; }
.cfr-head-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.cfr-head-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cfr-head-tools .fpr-filter.compact { flex-direction: row; align-items: center; gap: 6px; }
.cfr-head-tools .fpr-filter.compact > span { font-size: .66rem; }
.cfr-head-actions { display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 1px solid var(--rk-line); }
.cfr-updated { display: flex; flex-direction: column; align-items: flex-end; font-size: .66rem; color: var(--rk-muted); line-height: 1.3; white-space: nowrap; }
.cfr-updated b { color: var(--rk-ink-2); font-weight: 700; font-size: .72rem; }
.cfr-refresh { background: var(--rk-accent); border-color: var(--rk-accent); color: #fff; }
.cfr-refresh:hover:not(:disabled) { background: #1e40af; border-color: #1e40af; color: #fff; }
@media (max-width: 760px) { .cfr-head-actions { border-left: 0; padding-left: 0; } }

/* Nakit sayfalarında veri kapsamı kutusu daha sakin */

/* KPI kartları: görseldeki gibi iri değer, sade çerçeve, yumuşak gölge */
.cfr-page .rk-kpi { border-top-width: 1px; border-color: var(--rk-line); border-radius: 11px; padding: 12px 14px; min-height: 108px; }
.cfr-page a.rk-kpi:hover { border-color: #93c5fd; box-shadow: 0 6px 18px rgba(29, 78, 216, .08); transform: translateY(-1px); }
.cfr-page .rk-kpi-value { font-size: 1.36rem; }
.cfr-page .rk-kpi-title { font-size: .75rem; }

/* ── Rapor Merkezi (cfc-*) ───────────────────────────────────────────── */
.cfc-search { position: relative; display: block; width: min(360px, 90vw); }
.cfc-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--rk-faint); font-size: .8rem; }
.cfc-search input {
    width: 100%; height: 38px; padding: 0 12px 0 34px;
    border: 1px solid var(--rk-line); border-radius: 10px; background: #fff;
    font-size: .82rem; color: var(--rk-ink); outline: none;
}
.cfc-search input:focus { border-color: #93c5fd; box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.cfc-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .cfc-groups { grid-template-columns: 1fr; } }
.cfc-group {
    --g: var(--rk-accent);
    background: var(--rk-card); border: 1px solid var(--rk-line);
    border-top: 3px solid var(--g);
    border-radius: var(--rk-radius); box-shadow: var(--rk-shadow);
    display: flex; flex-direction: column;
}
.cfc-group-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 10px; }
.cfc-group-icon {
    width: 38px; height: 38px; border-radius: 10px; flex: none;
    display: grid; place-items: center;
    background: color-mix(in srgb, var(--g) 12%, #fff); color: var(--g); font-size: .95rem;
}
.cfc-group-head h2 { margin: 0; font-size: 1rem; font-weight: 800; color: var(--rk-ink); }
.cfc-group-head p { margin: 2px 0 0; font-size: .76rem; color: var(--rk-muted); }
.cfc-group-count {
    margin-left: auto; min-width: 26px; height: 22px; padding: 0 8px; border-radius: 999px;
    display: grid; place-items: center;
    background: #f1f5f9; color: var(--rk-muted); font-size: .7rem; font-weight: 800;
}
.cfc-list { display: flex; flex-direction: column; padding: 0 8px 8px; }
.cfc-item {
    display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 14px; gap: 12px; align-items: center;
    padding: 10px; border-radius: 10px;
    color: inherit; text-decoration: none;
    border-top: 1px solid var(--rk-line-2);
    transition: background .12s;
}
.cfc-item:first-child { border-top: 0; }
.cfc-item:hover { background: color-mix(in srgb, var(--g) 6%, #fff); }
.cfc-item-icon {
    width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
    background: #f8fafc; border: 1px solid var(--rk-line-2); color: var(--g); font-size: .82rem;
}
.cfc-item-body { display: flex; flex-direction: column; min-width: 0; }
.cfc-item-name { font-size: .86rem; font-weight: 750; color: var(--rk-ink); line-height: 1.3; }
.cfc-item-q { font-size: .75rem; color: var(--rk-muted); line-height: 1.35; margin-top: 2px; }
.cfc-item-code { font-size: .62rem; font-weight: 800; letter-spacing: .04em; color: var(--rk-faint); white-space: nowrap; }
.cfc-item-arrow { color: #cbd5e1; font-size: .72rem; transition: transform .12s, color .12s; }
.cfc-item:hover .cfc-item-arrow { color: var(--g); transform: translateX(2px); }
.cfc-item-empty .cfc-item-name, .cfc-item-empty .cfc-item-icon { opacity: .7; }
.cfc-flag {
    display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px;
    background: #f1f5f9; color: var(--rk-muted);
    font-style: normal; font-size: .58rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    vertical-align: middle;
}
.cfc-ops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .cfc-ops { grid-template-columns: 1fr; } }
.cfc-ops-card { padding: 12px 16px 14px; }
.cfc-ops-head { font-size: .86rem; font-weight: 800; color: var(--rk-ink); display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cfc-ops-head i { color: var(--rk-muted); }
.cfc-ops-head small { font-weight: 550; color: var(--rk-muted); font-size: .72rem; }
.cfc-ops-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cfc-ops-links a {
    display: inline-flex; align-items: center; gap: 7px;
    height: 32px; padding: 0 11px; border-radius: 8px;
    border: 1px solid var(--rk-line); background: #fff;
    color: var(--rk-ink-2); text-decoration: none; font-size: .76rem; font-weight: 650;
}
.cfc-ops-links a i { color: var(--rk-muted); font-size: .72rem; }
.cfc-ops-links a:hover { border-color: #bfdbfe; color: var(--rk-accent); background: var(--rk-accent-soft); }

/* ── Filtre çubuğu (5 kutu + katman anahtarı) ──────────────────────────── */
.cfr-filterbar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
    padding: 10px 12px;
    background: var(--rk-card);
    border: 1px solid var(--rk-line);
    border-radius: var(--rk-radius);
}
.cfr-filterbar .rk-toggles { min-height: 36px; align-items: center; }
.cfr-filter-wide { grid-column: span 2; }
@media (max-width: 1400px) { .cfr-filterbar { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px)  { .cfr-filterbar { grid-template-columns: 1fr; } .cfr-filter-wide { grid-column: auto; } }

/* ── Yerleşim ──────────────────────────────────────────────────────────── */
.cfr-two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.cfr-two-col-even { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .cfr-two-col, .cfr-two-col-even { grid-template-columns: 1fr; } }

/* ── Tablo satır türleri ───────────────────────────────────────────────── */
.cfr-neg { color: #b91c1c; }
.cfr-grid td.cfr-col-total, .cfr-grid th.cfr-col-total {
    border-left: 2px solid #94a3b8; background: #f8fafc; font-weight: 700;
}
.cfr-grid th.cfr-col-period { text-align: right; padding: 0 10px; }
.cfr-grid tr.cfr-r-opening td { background: #f8fbff !important; font-weight: 700; color: #0f172a; }
.cfr-grid tr.cfr-r-subtotal td { font-weight: 700; color: #0f172a; border-top: 1px solid #cbd5e1; background: #f8fafc !important; }
.cfr-grid tr.cfr-r-net td { font-weight: 800; color: #0b2f58; background: #eef4fb !important; border-top: 1px solid #b6c8dd; border-bottom: 1px solid #b6c8dd; }
.cfr-grid tr.cfr-r-change td { font-weight: 800; color: #0f172a; background: #f1f5f9 !important; border-top: 2px solid #64748b; }
.cfr-grid tr.cfr-r-closing td { font-weight: 800; color: #052e16; background: #ecfdf5 !important; border-bottom: 2px solid #16a34a; }
.cfr-grid tr.cfr-r-threshold td { color: #9a3412; font-style: italic; }
.cfr-grid tr.cfr-r-headroom td { font-weight: 700; color: #0f172a; }
.cfr-grid tr.cfr-r-info td { color: var(--rk-muted); font-size: .74rem; border-top: 1px dashed #cbd5e1; }
.cfr-grid tr.cfr-r-input td { color: var(--rk-ink-2); }

.cfr-cell-btn {
    all: unset; cursor: pointer; display: block; width: 100%; text-align: right;
    border-radius: 4px; padding: 0 2px; margin: 0 -2px;
}
.cfr-cell-btn:hover { background: var(--rk-accent-soft); color: var(--rk-accent); text-decoration: underline dotted; }

/* ── Katman rozeti ─────────────────────────────────────────────────────── */
.cfr-chip {
    display: inline-block; padding: 1px 8px; border-radius: 999px;
    font-size: .66rem; font-weight: 700; white-space: nowrap;
    background: #e2e8f0; color: #334155;
}
.cfr-chip-actual { background: var(--sc-actual-soft); color: var(--sc-actual-text); }
.cfr-chip-committed { background: #dcfce7; color: #166534; }
.cfr-chip-expected { background: #fef3c7; color: #92400e; }
.cfr-chip-forecast { background: var(--sc-forecast-soft); color: var(--sc-forecast-text); }
.cfr-chip-budget { background: var(--sc-budget-soft); color: var(--sc-budget-text); }

/* ── Drill paneli ──────────────────────────────────────────────────────── */
.cfr-drill-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .28); z-index: 1040; }
.cfr-drill {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 96vw);
    background: #fff; z-index: 1041; display: flex; flex-direction: column;
    box-shadow: -12px 0 32px rgba(15, 23, 42, .18);
}
.cfr-drill-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--rk-line); }
.cfr-drill-head h3 { margin: 0; font-size: 1rem; font-weight: 800; color: var(--rk-ink); }
.cfr-drill-head p { margin: 2px 0 0; font-size: .74rem; color: var(--rk-muted); }
.cfr-drill-summary { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 10px 18px; background: #f8fafc; border-bottom: 1px solid var(--rk-line-2); }
.cfr-drill-summary div { display: flex; flex-direction: column; }
.cfr-drill-summary span { font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--rk-muted); }
.cfr-drill-summary b { font-size: .9rem; color: var(--rk-ink); font-variant-numeric: tabular-nums; }
.cfr-drill-body { flex: 1; overflow: auto; }
.cfr-drill-grid { width: 100%; }
.cfr-drill-grid thead th { top: 0; }
.cfr-drill-desc { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.cfr-drill-desc small { display: block; color: var(--rk-muted); font-size: .68rem; }
.cfr-drill-foot { padding: 10px 18px; border-top: 1px solid var(--rk-line); display: flex; justify-content: flex-end; }

/* ── Karar paneli (risk / hedef-durum listesi) ─────────────────────────── */
.cfr-list { display: flex; flex-direction: column; }
.cfr-list-item { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rk-line-2); }
.cfr-list-item:last-child { border-bottom: 0; }
.cfr-list-item i { font-size: .95rem; text-align: center; }
.cfr-list-item strong { display: block; font-size: .8rem; color: var(--rk-ink); }
.cfr-list-item small { display: block; font-size: .7rem; color: var(--rk-muted); }
.cfr-list-item b { font-size: .84rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cfr-sev-high i, .cfr-sev-high b { color: #b91c1c; }
.cfr-sev-mid i, .cfr-sev-mid b { color: #b45309; }
.cfr-sev-low i, .cfr-sev-low b { color: #1d4ed8; }
.cfr-sev-ok i, .cfr-sev-ok b { color: #15803d; }

.cfr-status { display: inline-flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 700; }
.cfr-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cfr-status-ok { color: #15803d; }
.cfr-status-watch { color: #b45309; }
.cfr-status-risk { color: #b91c1c; }

/* ── Yazdırma ──────────────────────────────────────────────────────────── */
@media print {
    .cfn, .cfr-filterbar, .cfr-head-side, .cfr-drill, .cfr-drill-backdrop { display: none !important; }
    .cfr-print-scope { display: block; margin: 4px 0 0; font-size: .74rem; color: #334155; }
    .rk-grid-wrap { max-height: none !important; overflow: visible !important; }
}

/* Eşik altı gün / hafta satırı */
.cfr-grid tr.cfr-r-risk td { background: #fef2f2 !important; }
.cfr-grid tr.cfr-r-risk td.rk-sticky { border-left: 3px solid #dc2626; }

/* İki sütunlu yerleşimde kartlar içerikleri kadar uzar; boş durum kartı yarım ekranı kaplamaz. */
.cfr-two-col, .cfr-two-col-even { align-items: start; }
.cfr-page .rk-state.cfr-state-compact { min-height: 0; padding: 18px 16px; flex-direction: row; gap: 10px; justify-content: flex-start; }
.cfr-page .rk-state.cfr-state-compact i { font-size: 1.1rem; margin: 0; color: #15803d; }
.cfr-page .rk-state.cfr-state-compact p { margin: 0; }

/* Vadesi geçmiş, gerçekleşmemiş kalem (Nakit Takvimi) */
.cfr-page tr.cfr-r-overdue td { background: #fef2f2 !important; }
.cfr-page tr.cfr-r-overdue td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
.cfr-overdue-tag {
    display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px;
    background: #fee2e2; color: #b91c1c; font-size: .62rem; font-weight: 800; white-space: nowrap;
}

/* Nakit akış tablosunda kod sütunu: IAS 7 satır kodları (OP_OUT_INCTAX, INV_IN_INTEREST) kesilmeden okunur */
.cfr-page .rk-col-code { min-width: 132px; white-space: nowrap; font-variant-numeric: normal; }
