/* =============================================================
   NKU Kurumsal Takim - 05 Grafik takimi (.ng)
   Kutucuk, parcali cubuk, sirali / gruplu / acilir yatay cubuklar, grafik karti ve ortak ipucu.
   Renkler dogrulandi (dataviz validate_palette, yuzey #fff, acik tema):
   seri 1-3 her ciftte gecer; seri 3 yuzeye karsi 3:1 altinda oldugu icin
   degerler her zaman yazi olarak da (kutucuk ya da tablo) verilir.
   Panel dosyalarindan bagimsizdir; js/nku-grafik.js ile birlikte kullanilir.
   ============================================================= */

.ng {
    --ng-yuzey: #FFFFFF;
    --ng-metin: #1B2340;
    --ng-metin-ikincil: #646D8A;
    --ng-cizgi: #E3E7F0;
    --ng-taban: #C3C2B7;
    --ng-iz: #ECEEF4;
    --ng-seri-1: #2A78D6;
    --ng-seri-2: #EB6834;
    --ng-seri-3: #1BAF7A;
    /* Sıralı (ordinal) mavi rampa: yıllar gibi sıralı seriler, eskiden yeniye açıktan koyuya (validate_palette --ordinal geçti). */
    --ng-sira-1: #86B6EF;
    --ng-sira-2: #5598E7;
    --ng-sira-3: #256ABF;
    --ng-sira-4: #104281;
}
.ng-kutucuklar { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; margin-bottom: 16px; }
.ng-kutucuk { padding: 16px 18px; border: 1px solid var(--ng-cizgi); border-radius: 12px; background: var(--ng-yuzey); }
.ng-kutucuk-etiket { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ng-metin-ikincil); font-size: 12.5px; font-weight: 600; }
.ng-kutucuk-deger { margin: 6px 0 0; color: var(--ng-metin); font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ng-kutucuk-birim { margin-left: 4px; color: var(--ng-metin-ikincil); font-size: 15px; font-weight: 600; }
.ng-kutucuk-alt { margin: 4px 0 0; color: var(--ng-metin-ikincil); font-size: 12px; }
.ng-kutucuk.vurgu { border-color: #C6CDEC; background: #F7F8FD; }
/* Seri anahtarı: işaretin biçimini tekrarlar (çubuk için köşeli kare). Yazı hiçbir zaman seri renginde olmaz. */
.ng-anahtar { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 3px; background: var(--renk, var(--ng-seri-1)); }
.ng-anahtar.iz { background: var(--ng-iz); box-shadow: inset 0 0 0 1px var(--ng-taban); }
.ng-parcali-kutu { margin: 4px 0 0; }
.ng-parcali { display: flex; gap: 2px; height: 28px; }
.ng-parca {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 2px;
    border-radius: 4px;
    background: var(--renk);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: default;
    outline: none;
    transition: filter .12s ease;
}
.ng-parca span { padding: 0 8px; }
.ng-parca.iz { background: var(--ng-iz); color: var(--ng-metin-ikincil); }
.ng-parca:hover { filter: brightness(1.1); }
.ng-parca:focus-visible { box-shadow: 0 0 0 2px var(--ng-yuzey), 0 0 0 4px var(--ng-metin); }
.ng-aciklama { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; padding: 0; list-style: none; color: var(--ng-metin-ikincil); font-size: 12.5px; font-weight: 600; }
.ng-aciklama li { display: inline-flex; align-items: center; gap: 7px; }
.ng-sirali { display: grid; grid-template-columns: minmax(110px, 32%) minmax(0, 1fr); gap: 4px 16px; margin: 0; }
.ng-sirali-satir { display: contents; }
.ng-sirali-ad { display: flex; flex-direction: column; justify-content: center; min-height: 36px; padding: 4px 0; color: var(--ng-metin); font-size: 13px; font-weight: 600; }
.ng-sirali-ad small { color: var(--ng-metin-ikincil); font-size: 11.5px; font-weight: 500; }
.ng-sirali-alan { display: flex; align-items: center; gap: 8px; min-height: 36px; border-left: 1px solid var(--ng-taban); border-radius: 0 6px 6px 0; cursor: default; outline: none; }
.ng-sirali-alan:hover { background: #F7F8FC; }
.ng-sirali-alan:focus-visible { box-shadow: 0 0 0 2px var(--ng-metin); }
.ng-cubuk { flex: 0 0 auto; width: calc((100% - 10em) * var(--oran, 0)); height: 16px; border-radius: 0 4px 4px 0; background: var(--renk, var(--ng-seri-1)); }
.ng-sirali-alan:hover .ng-cubuk { filter: brightness(1.1); }
.ng-cubuk-deger { color: var(--ng-metin); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.ng-cubuk-deger.eksi { color: #B42318; }
@media (max-width: 560px) {
    .ng-sirali { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .ng-sirali-ad { min-height: 0; padding-top: 10px; }
}
/* keen-dashboards .chart-stage içinde kullanıldığında grafik alanı, üstündeki kayan (Bootstrap col) tablonun altına iner. */
.chart-stage.ng { clear: both; padding-top: 12px; }
.ng-kart { margin: 0 0 22px; border: 1px solid var(--ng-cizgi); border-radius: 14px; background: var(--ng-yuzey); box-shadow: 0 1px 2px rgba(16, 24, 64, .05), 0 6px 20px -12px rgba(16, 24, 64, .18); overflow: hidden; }
.ng-kart-bas { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 14px 18px; border-bottom: 1px solid var(--ng-cizgi); background: #FAFBFE; }
.ng-kart-baslik { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--ng-metin); font-size: 15px; font-weight: 700; line-height: 1.3; }
.ng-kart-baslik::before { content: ""; flex: none; width: 4px; height: 18px; border-radius: 2px; background: var(--ng-seri-1); }
.ng-kart-indir { display: flex; gap: 6px; }
.ng-indir-dugme { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid #D5DBEA; border-radius: 8px; background: #fff; color: #3B4566; font-size: 12.5px; font-weight: 600; line-height: 1.2; cursor: pointer; transition: background-color .12s ease, border-color .12s ease; }
.ng-indir-dugme:hover { border-color: #AEB8D6; background: #F2F4FB; }
.ng-indir-dugme:focus-visible { outline: 2px solid var(--ng-metin); outline-offset: 2px; }
.ng-indir-dugme .fa-file-image-o { color: #2A78D6; }
.ng-indir-dugme .fa-file-excel-o { color: #1B8A5A; }
.ng-indir-dugme[disabled] { opacity: .6; cursor: progress; }
.ng-kart-not { margin: 12px 18px 0; }
.ng-kart-ic { padding: 16px 18px 18px; }
.ng-kart-ic > .ng-kutucuklar:last-child { margin-bottom: 0; }
/* Veri tabloları (DataTables) için kart: tablo kenara yapışmaz, kaydırma kartın içinde kalır. */
.ng-tablo-kart .ng-kart-ic { overflow-x: auto; }
.ng-tablo-kart table.dataTable { margin: 0 !important; }
.ng-tablo-kart .dt-buttons { margin-bottom: 10px; }
.ng-tablo-kart .dataTables_filter { margin-bottom: 10px; }
.ng-tablo-kart .dataTables_info { padding-top: 10px; color: var(--ng-metin-ikincil); font-size: 12.5px; }
.ng-gruplu-alan { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 36px; padding: 5px 0; border-left: 1px solid var(--ng-taban); }
.ng-gruplu-cizgi { display: flex; align-items: center; gap: 6px; min-height: 12px; border-radius: 0 4px 4px 0; cursor: default; outline: none; }
.ng-gruplu-cizgi:hover { background: #F7F8FC; }
.ng-gruplu-cizgi:focus-visible { box-shadow: 0 0 0 2px var(--ng-metin); }
.ng-gruplu-cizgi .ng-cubuk { height: 10px; border-radius: 0 3px 3px 0; }
.ng-gruplu-cizgi .ng-cubuk-deger { font-size: 11.5px; font-weight: 600; }
.ng-gruplu + .ng-aciklama, .ng-aciklama + .ng-gruplu { margin-top: 12px; }
/* Satırlar ince çizgiyle ayrılır; sıfır değerler soluk yazılır ki dolu çubuklar öne çıksın. */
.ng-gruplu { row-gap: 0; }
.ng-gruplu .ng-sirali-satir > .ng-sirali-ad,
.ng-gruplu .ng-sirali-satir > .ng-gruplu-alan { border-bottom: 1px solid var(--ng-cizgi); }
.ng-gruplu .ng-sirali-satir:last-child > * { border-bottom: 0; }
.ng-gruplu-alan { padding: 7px 0; }
.ng-cubuk-deger.sifir { color: #A9AFC3; font-weight: 500; }
.ng-inen { margin: 0; }
.ng-inen-satir { border-bottom: 1px solid var(--ng-cizgi); }
.ng-inen-satir:last-child { border-bottom: 0; }
.ng-inen-satir > summary { display: grid; grid-template-columns: minmax(110px, 32%) minmax(0, 1fr) 20px; gap: 4px 16px; align-items: center; list-style: none; cursor: pointer; outline: none; }
.ng-inen-satir > summary::-webkit-details-marker { display: none; }
.ng-inen-satir > summary::after { content: "\f107"; color: var(--ng-metin-ikincil); font-family: FontAwesome; font-size: 15px; text-align: center; transition: transform .15s ease; }
.ng-inen-satir[open] > summary::after { transform: rotate(180deg); }
.ng-inen-satir > summary:hover { background: #F7F8FC; }
.ng-inen-satir > summary:focus-visible { box-shadow: inset 0 0 0 2px var(--ng-metin); }
.ng-inen-satir > summary .ng-sirali-alan { border-radius: 0; }
.ng-inen-satir > summary .ng-sirali-alan:hover { background: transparent; }
.ng-inen-alt { margin: 4px 0 12px; padding: 10px 14px; border-radius: 8px; background: #F7F8FC; }
.ng-inen-alt .ng-sirali-ad, .ng-inen-alt .ng-sirali-alan { min-height: 28px; }
.ng-inen-alt .ng-cubuk { height: 12px; }
.ng-inen-bos { margin: 0; color: var(--ng-metin-ikincil); font-size: 12.5px; }
@media (max-width: 560px) {
    .ng-inen-satir > summary { grid-template-columns: minmax(0, 1fr) 20px; }
    .ng-inen-satir > summary .ng-sirali-alan { grid-column: 1 / -1; grid-row: 2; }
}
.ng-not { display: flex; gap: 8px; margin: 12px 0 0; color: var(--ng-metin-ikincil); font-size: 12.5px; }
.ng-not .fa { margin-top: 2px; }
.ng-ipucu {
    position: fixed;
    z-index: 1080;
    max-width: 280px;
    padding: 8px 11px;
    border: 1px solid rgba(11, 11, 11, .10);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px -10px rgba(11, 18, 54, .35);
    color: var(--ng-metin, #1B2340);
    font-size: 12.5px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .1s ease;
}
.ng-ipucu.acik { opacity: 1; }
.ng-ipucu-deger { display: block; font-size: 14px; font-weight: 700; }
.ng-ipucu-ad { display: flex; align-items: center; gap: 6px; margin-top: 2px; color: #646D8A; font-weight: 600; }
.ng-ipucu-ad::before { content: ""; flex: 0 0 auto; width: 12px; height: 2px; border-radius: 1px; background: var(--renk, transparent); }
.ng-ipucu-ek { display: block; margin-top: 2px; color: #646D8A; }
@media print {
    .ng-parca, .ng-cubuk, .ng-anahtar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* Kart açıklaması (2026-11-18): .ng-not dosyada .ng-kart-not'tan sonra geldiği için yan boşluğu sıfırlıyor, açıklama kart kenarına yapışıyordu.
   Kural yukarı taşınmaz; aynı boşluk daha belirgin seçiciyle burada verilir. */
.ng-not.ng-kart-not { margin: 12px 18px 0; }

/* ---------- Dikey sütunlar (grafik._sutunlar, 2026-11-18) ----------
   Az kalemli tek seri; değer üstte, ad altta. Sütun ince (en çok 48px), tepesi 4px yuvarlak, tabana oturur. */
.ng-sutunlar { display: flex; justify-content: center; align-items: stretch; gap: 14px; padding-top: 6px; }
.ng-sutun { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; max-width: 140px; }
.ng-sutun-alan { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 230px; border-bottom: 1px solid var(--ng-taban); border-radius: 6px 6px 0 0; cursor: default; outline: none; }
.ng-sutun-alan:hover { background: #F7F8FC; }
.ng-sutun-alan:focus-visible { box-shadow: 0 0 0 2px var(--ng-metin); }
.ng-sutun-alan .ng-cubuk { width: min(48px, 72%); height: calc(190px * var(--oran, 0)); min-height: 2px; border-radius: 4px 4px 0 0; }
.ng-sutun-alan:hover .ng-cubuk { filter: brightness(1.1); }
.ng-sutun-ad { display: -webkit-box; margin-top: 8px; overflow: hidden; color: var(--ng-metin); font-size: 12px; font-weight: 600; line-height: 1.3; text-align: center; overflow-wrap: anywhere; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
/* Açılır grafiğin alt kırılımında (ng-inen-alt) sütunlar daha alçak. */
.ng-inen-alt .ng-sutun-alan { height: 170px; }
.ng-inen-alt .ng-sutun-alan .ng-cubuk { height: calc(130px * var(--oran, 0)); }
@media (max-width: 575px) {
    .ng-sutunlar { gap: 6px; }
    .ng-sutun-alan { height: 190px; }
    .ng-sutun-alan .ng-cubuk { height: calc(150px * var(--oran, 0)); }
    .ng-sutun-ad { font-size: 11px; }
    .ng-sutun-alan .ng-cubuk-deger { font-size: 11.5px; white-space: normal; text-align: center; }
    .ng-inen-alt .ng-sutun-alan { height: 150px; }
    .ng-inen-alt .ng-sutun-alan .ng-cubuk { height: calc(110px * var(--oran, 0)); }
}

/* ---------- Açılır dikey sütunlar (grafik._inen-sutunlar, 2026-11-18) ----------
   Sütun bir düğmedir; seçilince altında kırılımı (.ng-inen-sutun-alt) açılır. 8'den çok sütunda adlar 45° eğik. */
.ng-inen-sutun .ng-sutun-alan { width: 100%; padding: 0; border-top: 0; border-right: 0; border-left: 0; background: none; font: inherit; }
.ng-inen-sutun .ng-sutun-alan { cursor: pointer; }
.ng-inen-sutun .ng-sutun-alan:hover,
.ng-inen-sutun .ng-sutun-alan[aria-expanded="true"] { background: #EEF3FC; }
.ng-inen-sutun .ng-sutun-alan[aria-expanded="true"] .ng-cubuk-deger { color: var(--ng-seri-1); }
.ng-inen-sutun-alt { margin-top: 14px; padding: 14px 12px 6px; border-radius: 10px; background: #FBFAF8; box-shadow: inset 0 0 0 1px #F3E3DA; }
.ng-inen-sutun-baslik { margin: 0 0 6px; color: var(--ng-metin-ikincil); font-size: 12.5px; text-align: center; }
.ng-inen-sutun-baslik b { color: var(--ng-metin); }
.ng-sutun-ad > span { display: inline; }
.ng-sutunlar-egik { justify-content: flex-start; gap: 6px; padding-left: 120px; overflow-x: auto; overflow-y: hidden; }
.ng-sutunlar-egik .ng-sutun { min-width: 40px; max-width: 90px; }
.ng-sutunlar-egik .ng-cubuk-deger { font-size: 11.5px; white-space: normal; text-align: center; line-height: 1.2; }
.ng-sutunlar-egik .ng-sutun-ad { display: block; position: relative; height: 130px; margin-top: 6px; overflow: visible; -webkit-line-clamp: unset; line-clamp: unset; }
.ng-sutunlar-egik .ng-sutun-ad > span { position: absolute; top: 2px; right: 50%; max-width: 170px; overflow: hidden; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; transform: rotate(-45deg); transform-origin: 100% 0; }
@media (max-width: 575px) {
    .ng-sutunlar-egik { padding-left: 110px; }
}