html, body {
    height: 100%;
    margin: 0;
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
}

h1:focus { outline: none; }

/* ---------- genel yerleşim ---------- */
.uygulama { display: flex; flex-direction: column; height: 100vh; }
.ust-serit {
    display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 16px;
    background: #2b579a; color: #fff; flex: 0 0 auto;
}
.uygulama-adi { font-size: 17px; font-weight: 600; }
.ust-serit-bosluk { flex: 1; }
.kullanici { opacity: .9; }
.icerik { flex: 1; min-height: 0; overflow: hidden; background: #f3f3f3; }

/* ---------- giriş ---------- */
.giris-kutusu {
    max-width: 380px; width: 100%; margin: 0; padding: 28px; background: #fff;
    border-radius: 8px; box-shadow: 0 2px 14px rgba(0,0,0,.12);
}
.giris-logo { display: block; width: 88px; height: 88px; margin: 0 auto 14px; border-radius: 20px; box-shadow: 0 4px 14px rgba(114,52,224,.35); }
.giris-kutusu { text-align: center; }
.giris-kutusu .alan-etiketi, .giris-kutusu .hata-seridi { text-align: left; }
.giris-kutusu h1 { font-size: 22px; margin: 0 0 6px; }
.giris-kutusu .alt-baslik { color: #666; margin-bottom: 18px; }
.alan-etiketi { display: block; margin: 12px 0 4px; font-weight: 600; }

/* ---------- rapor sayfası ---------- */
.rapor-sayfa { display: flex; flex-direction: column; height: 100%; }
.arac-cubugu {
    display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; padding: 8px 12px;
    background: #fff; border-bottom: 1px solid #d8d8d8; flex: 0 0 auto;
}
.arac-grubu { display: flex; flex-direction: column; gap: 2px; }
.arac-grubu > label { font-size: 12px; color: #555; }
.arac-ayrac { width: 1px; align-self: stretch; background: #ddd; margin: 0 2px; }
.hata-seridi {
    display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: #fdecea; color: #8a1c13;
    border-bottom: 1px solid #f3c1bc; flex: 0 0 auto;
}
.hata-seridi span { flex: 1; }

.govde { flex: 1; min-height: 0; display: grid; grid-template-columns: 270px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 8px; padding: 8px; }
.sol-panel { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.kutu {
    background: #fff; border: 1px solid #d8d8d8; border-radius: 6px; display: flex; flex-direction: column;
    min-height: 0; overflow: hidden;
}
.kutu-baslik { padding: 7px 10px; font-weight: 600; background: #f7f7f7; border-bottom: 1px solid #e3e3e3; flex: 0 0 auto; }
.kutu-icerik { flex: 1; min-height: 0; overflow: auto; padding: 4px; }
.kaynak-agaci { flex: 1 1 45%; }
.alan-listesi { flex: 1 1 55%; }

.sag-panel { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.bolgeler { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(205px, 1fr); gap: 8px; height: 235px; flex: 0 0 auto; overflow-x: auto; }

/* ---------- sonuç ---------- */
.sonuc-kutu { flex: 1; min-height: 0; height: 100%; }
.sonuc-icerik { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.sonuc-grid, .pivot-kutu { flex: 1; min-height: 0; height: 100%; }
.sonuc-bos { color: #777; padding: 24px; text-align: center; }
.rehber { padding: 10px 14px; background: #fffbe6; border: 1px solid #f1e4a8; border-radius: 6px; line-height: 1.7; flex: 0 0 auto; }

.durum-seridi { padding: 5px 12px; background: #fff; border-top: 1px solid #d8d8d8; color: #444; flex: 0 0 auto; min-height: 28px; }

#blazor-error-ui {
    color-scheme: light only; background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    box-sizing: border-box; display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

/* ---------- üst menü / firma-dönem ---------- */
.menu { display: flex; gap: 4px; margin-left: 18px; }
.menu-oge { white-space: nowrap; font-size: 13px; color: #fff; text-decoration: none; padding: 6px 9px; border-radius: 4px; opacity: .85; display: inline-flex; align-items: center; gap: 7px; }
.menu-oge .ik { vertical-align: 0; }
.menu-oge:hover { background: rgba(255,255,255,.15); opacity: 1; }
.menu-oge.active { background: rgba(255,255,255,.25); opacity: 1; font-weight: 600; }
.ust-secim { display: flex; align-items: center; gap: 8px; }
.ust-secim label { font-size: 12.5px; opacity: .9; }

/* ---------- sol panel ---------- */
.sol-panel { min-height: 0; }
.kutu-alt { padding: 6px 10px; font-size: 12px; color: #666; border-top: 1px solid #e8e8e8; background: #fafafa; }

/* ---------- tasarım: kartlar ---------- */
.sag-splitter { height: 100%; min-height: 0; }
.kartlar-kutu { min-width: 0; }
.kartlar-kutu > .kartlar { flex: 1; min-height: 0; }
.popup-sonuc { display: flex; flex-direction: column; height: calc(90vh - 150px); min-height: 0; }
.kartlar { display: flex; align-items: stretch; gap: 0; height: 100%; overflow-x: auto; overflow-y: hidden; padding: 4px 2px; }
.kart-bos { margin: auto; max-width: 760px; padding: 14px 18px; background: #fffbe6; border: 1px solid #f1e4a8; border-radius: 6px; line-height: 1.8; }
.kart { flex: 0 0 auto; width: 905px; display: flex; flex-direction: column; background: #fff; border: 1px solid #cdd6e4; border-radius: 6px; min-height: 0; overflow: hidden; }
.kart-baslik { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: #2b579a; color: #fff; flex: 0 0 auto; }
.kart-ad { font-weight: 700; flex: 1; font-size: 14px; }
.kart-adet { opacity: .85; font-size: 12px; }
.kart-baslik .dxbl-btn { color: #fff !important; }
.kart-grid { width: 100%; flex: 1; min-height: 0; height: 100%; }

.iliski-baglanti {
    flex: 0 0 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    cursor: pointer; color: #2b579a; user-select: none;
}
.iliski-baglanti:hover { background: #eef3fb; }
.iliski-etiket { font-weight: 700; font-size: 12px; letter-spacing: 1px; }
.iliski-ok { font-size: 34px; line-height: 1; }
.iliski-sayi { font-size: 11.5px; }
.iliski-yok { color: #c0392b; }

.filtre-hucre { display: flex; gap: 4px; align-items: center; }
.filtre-hucre > * { flex: 1; min-width: 0; }
.filtre-hucre .filtre-kosul { flex: 0 0 96px; }
.filtre-yok { color: #aaa; padding-left: 8px; }
.filtre-ozel { font-size: 12px; color: #8a5a00; }
.alan-kullanimda-ad { font-weight: 600; color: #1b5e20; }

/* ---------- ilişki penceresi ---------- */
.iliski-panel { display: flex; flex-direction: column; gap: 8px; }
.iliski-aciklama { color: #555; font-size: 13px; line-height: 1.5; }
.iliski-satir { display: flex; gap: 8px; align-items: center; }
.iliski-satir > * { flex: 1; min-width: 0; }
.iliski-satir .iliski-es { flex: 0 0 auto; font-weight: 700; }
.iliski-satir .iliski-tur { flex: 0 0 240px; }
.bolge-bos { color: #8a8a8a; font-size: 12.5px; padding: 6px; }

/* ---------- pivot ---------- */
.pivot-arac { display: flex; gap: 8px; align-items: center; padding: 6px 8px; flex: 0 0 auto; border-bottom: 1px solid #eee; }
.pivot-not { color: #777; font-size: 12px; }

/* ---------- bekleme penceresi ---------- */
.bekle-katman {
    position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.55); backdrop-filter: blur(1px); cursor: wait;
}
.bekle-kutu {
    min-width: 280px; padding: 22px 30px; background: #fff; border-radius: 10px; text-align: center;
    box-shadow: 0 6px 28px rgba(0,0,0,.25); display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.bekle-gosterge { width: 46px; height: 46px; }
.bekle-metin { font-weight: 600; font-size: 15px; }
.bekle-alt { color: #777; font-size: 12.5px; }
.ust-logo { width: 28px; height: 28px; border-radius: 7px; }

/* ---------- genel sayfalar ---------- */
.arac-bilgi { color: #666; font-size: 13px; align-self: center; margin-left: 6px; }
.tam-iframe { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
.form-sayfa { height: 100%; overflow: auto; padding: 16px; display: flex; justify-content: center; align-items: flex-start; }
.form-kutu { width: 100%; max-width: 980px; }
.form-icerik { display: flex; flex-direction: column; gap: 8px; padding: 14px !important; }
.sql-kutu textarea { font-family: Consolas, 'Courier New', monospace; font-size: 13px; }
.hata-listesi { max-height: 240px; overflow: auto; border: 1px solid #f3c1bc; border-radius: 4px; background: #fffafa; }
.hata-satir { padding: 5px 10px; border-bottom: 1px solid #f6dedb; font-family: Consolas, monospace; font-size: 12.5px; }
.sonuc-iyi { color: #2e7d32; font-weight: 600; }
.sonuc-kotu { color: #c0392b; font-weight: 600; }
.flex-1 { flex: 1; }

/* ---------- dashboard ---------- */
.panel-sayfa { height: 100%; display: flex; flex-direction: column; }
.panel-ust { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: #fff; border-bottom: 1px solid #ddd; flex: 0 0 auto; }
.panel-baslik { font-size: 20px; font-weight: 700; }
.panel-alt { color: #777; font-size: 12.5px; }
.panel-icerik { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.kpi-satir { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; flex: 0 0 auto; }
.kpi { position: relative; background: #fff; border: 1px solid #e0e0e0; border-left: 5px solid var(--vurgu); border-radius: 6px; padding: 10px 14px; min-width: 0; }
.kpi-ikon { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--vurgu); color: #fff; font-size: 20px; margin-bottom: 4px; }
.kpi-ikon .ik { vertical-align: 0; }
.panel-baslik .ik, .kutu-baslik .ik { margin-right: 6px; color: #2b579a; }
.kpi-ad { color: #777; font-size: 12.5px; margin-top: 2px; }
.kpi-deger { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-trend { font-size: 12px; min-height: 16px; }
.grafik-satir { display: flex; gap: 10px; height: 465px; flex: 0 0 auto; }
.grafik-kutu { min-width: 0; }
.grafik-icerik { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.grafik { position: absolute; inset: 6px 6px 20px 6px; width: auto; height: auto; }
.tablo-kutu { height: 440px; flex: 0 0 auto; }
.tablo-icerik { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 6px; }
.tablo-aciklama { font-weight: 600; padding: 2px 4px 6px; }
.risk-yuksek { color: #c0392b; font-weight: 700; background: #fdebeb; padding: 2px 6px; border-radius: 3px; }
/* ---------- giriş sayfası ---------- */
.giris-sayfa {
    min-height: 100vh; height: 100vh; box-sizing: border-box; padding: 24px; position: relative;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: #2b1a6b url('giris-arkaplan.svg') center / cover no-repeat;
}
.giris-sayfa::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(20,10,70,0) 35%, rgba(20,10,70,.45) 100%); pointer-events: none; }
.giris-sayfa > * { position: relative; z-index: 1; }
.icerik:has(.giris-sayfa) { background: #2b1a6b; }

.giris-kutusu {
    width: 100%; max-width: 420px; padding: 40px 38px 32px; background: rgba(255,255,255,.97); text-align: left;
    border-radius: 16px; box-shadow: 0 18px 60px rgba(15,6,60,.55);
}
.giris-logo { display: block; width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 17px; box-shadow: 0 6px 18px rgba(114,52,224,.4); }
.giris-kutusu h2 { margin: 0 0 8px; font-size: 28px; font-weight: 700; color: #1f1650; text-align: center; letter-spacing: -.5px; }
.giris-kutusu .alt-baslik { color: #6b6890; margin-bottom: 10px; text-align: center; line-height: 1.5; font-size: 13.5px; }
.giris-kutusu .alan-etiketi { margin: 16px 0 6px; font-size: 13px; color: #3b3868; }
.giris-hata { margin-top: 16px; padding: 10px 12px; background: #fdecea; color: #8a1c13; border: 1px solid #f3c1bc; border-radius: 6px; font-size: 13.5px; }
.giris-dugme { width: 100%; margin-top: 24px; height: 44px; font-size: 15px; font-weight: 600; background: #6d35e0 !important; border-color: #6d35e0 !important; }
.giris-dugme:hover { filter: brightness(1.08); }
.giris-not { margin-top: 16px; text-align: center; color: #8a87a8; font-size: 12.5px; }
.giris-telif { margin-top: 22px; color: rgba(255,255,255,.75); font-size: 12.5px; }
.pivot-sarmal { flex: 1; min-height: 0; overflow: auto; }
.pivot-sarmal .pivot-kutu { height: auto; min-height: 100%; }

/* ---------- giriş: özellik listesi (kartın solunda) ---------- */
.giris-ozellikler {
    list-style: none; margin: 0; padding: 0; color: #fff; font-size: 15px;
    position: absolute; left: 5vw; top: 50%; transform: translateY(-50%); width: min(24vw, 360px);
    display: flex; flex-direction: column; gap: 18px;
}
.giris-ozellikler li { display: flex; gap: 12px; align-items: flex-start; line-height: 1.5; text-shadow: 0 1px 8px rgba(15,6,60,.6); }
.ozellik-tik {
    flex: 0 0 24px; height: 24px; border-radius: 50%; background: rgba(52,211,153,.25); color: #34d399;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
/* dar ekranlarda soldaki alan kalmaz: maddeler kartın altına iner */
@media (max-width: 1280px) {
    .giris-ozellikler { position: static; transform: none; width: 100%; max-width: 420px; margin-top: 24px; gap: 12px; font-size: 14px; }
}
.giris-telif a { color: inherit; text-decoration: none; }
.giris-telif a:hover { color: #fff; text-decoration: underline; }
.grafik-ipucu { margin: 8px 12px; }
.grafik-ipucu { margin: 8px 12px; }
.kart-arama { padding: 6px 8px; border-bottom: 1px solid #e3e8f0; flex: 0 0 auto; }
.kart-arama-kutu { width: 100%; padding: 5px 8px; border: 1px solid #c8d0dc; border-radius: 4px; font: inherit; }
.kart-tablo-kap { flex: 1; min-height: 0; overflow: auto; }
.kart-tablo { border-collapse: collapse; width: 100%; table-layout: fixed; }
.kart-tablo th { position: sticky; top: 0; z-index: 1; background: #eef2f8; border-bottom: 1px solid #cdd6e4; padding: 5px 6px; font-size: 12px; font-weight: 600; text-align: left; }
.kart-tablo td { border-bottom: 1px solid #edf0f5; padding: 2px 6px; vertical-align: middle; font-size: 13px; }
.kart-tablo .k-sec { width: 84px; text-align: center; }
.kart-tablo .k-top { width: 140px; }
.kart-tablo .k-ad { width: 220px; }
.kart-tablo .k-fil { width: 290px; }
.kart-tablo tbody tr:hover { background: #f4f8ff; }
.grafik-satir-alt { height: 380px; }
.grafik-bos { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #999; font-size: 13px; }

.kart-secim { width: 100%; padding: 4px 6px; border: 1px solid #c8d0dc; border-radius: 4px; font: inherit; background: #fff; }
.grup-ozet { margin-left: 18px; color: #5b6b80; font-weight: normal; }
.grup-ozet b { color: #1f2d3d; }

.sql-metin { margin: 0; padding: 12px; max-height: 60vh; overflow: auto; background: #f4f6f9; border: 1px solid #c8d0dc; border-radius: 4px; font: 13px/1.45 Consolas, monospace; white-space: pre; }

.kart-surukle { cursor: grab; }
.kart-surukle:active { cursor: grabbing; }
