:root {
    --zemin: #f5f6f8;
    --yuzey: #ffffff;
    --cizgi: #e2e5ea;
    --metin: #1d2330;
    --soluk: #5f6b7a;
    --vurgu: #1f6feb;
    --vurgu-metin: #ffffff;
    --borc: #b42318;
    --alacak: #157f3c;
    --serit: #fff4d6;
    --serit-metin: #6b4a00;
    --golge: 0 1px 2px rgba(16, 24, 40, .06);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --zemin: #0f1217;
        --yuzey: #171b22;
        --cizgi: #2a303a;
        --metin: #e6e9ee;
        --soluk: #9aa4b2;
        --vurgu: #4c8dff;
        --borc: #ff7b72;
        --alacak: #56d364;
        --serit: #3a2f12;
        --serit-metin: #f5d68a;
        --golge: none;
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--zemin);
    color: var(--metin);
    font: 15px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

a { color: var(--vurgu); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font-size: 1.4rem; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .75rem; }

.gizli { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.soluk { color: var(--soluk); }

/* Üst menü */
.ust { background: var(--yuzey); border-bottom: 1px solid var(--cizgi); }
.ust-ic {
    max-width: 1200px; margin: 0 auto; padding: .6rem 1rem;
    display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem;
}
.marka { display: flex; align-items: center; gap: .75rem; }
.firma { font-weight: 600; }
.firma-sec { display: flex; gap: .4rem; }
.menu { display: flex; gap: .25rem; flex: 1; overflow-x: auto; }
.menu a { padding: .35rem .7rem; border-radius: 6px; color: var(--metin); white-space: nowrap; }
.menu a.etkin { background: var(--vurgu); color: var(--vurgu-metin); }
.menu a:hover { text-decoration: none; background: var(--cizgi); }
.menu a.etkin:hover { background: var(--vurgu); }
.kullanici { display: flex; align-items: center; gap: .6rem; color: var(--soluk); }

.serit { background: var(--serit); color: var(--serit-metin); padding: .6rem 1rem; text-align: center; }

.icerik { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem 2rem; }
.alt { max-width: 1200px; margin: 0 auto; padding: 0 1rem 1.5rem; color: var(--soluk); font-size: .85rem; }

/* Form öğeleri */
input, select, button { font: inherit; color: inherit; }
input, select {
    background: var(--yuzey); border: 1px solid var(--cizgi); border-radius: 6px; padding: .4rem .6rem; min-height: 2.25rem;
}
button {
    background: var(--vurgu); color: var(--vurgu-metin); border: 0; border-radius: 6px; padding: .4rem .9rem; cursor: pointer;
    min-height: 2.25rem;
}
button.ikincil { background: transparent; color: var(--metin); border: 1px solid var(--cizgi); }

.filtre { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: 1rem; }
.filtre label { display: flex; flex-direction: column; font-size: .85rem; color: var(--soluk); gap: .2rem; }
.filtre .onay { flex-direction: row; align-items: center; gap: .4rem; color: var(--metin); }

/* Kartlar ve özet */
.kart { background: var(--yuzey); border: 1px solid var(--cizgi); border-radius: 10px; padding: 1rem; box-shadow: var(--golge); }
.ozet { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.ozet .kart span { display: block; color: var(--soluk); font-size: .85rem; }
.ozet .kart strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.bilgiler { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0; }
.bilgiler dt { color: var(--soluk); }
.bilgiler dd { margin: 0; }

/* Tablolar */
.tablo-kap { background: var(--yuzey); border: 1px solid var(--cizgi); border-radius: 10px; overflow-x: auto; box-shadow: var(--golge); }
table.liste { width: 100%; border-collapse: collapse; }
.liste th, .liste td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--cizgi); vertical-align: top; }
.liste th { font-size: .8rem; font-weight: 600; color: var(--soluk); text-transform: uppercase; letter-spacing: .02em; }
.liste tr:last-child td { border-bottom: 0; }
.liste tfoot td { font-weight: 600; }
.sayi { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.borc { color: var(--borc); }
.alacak { color: var(--alacak); }
.bos { padding: 2rem; text-align: center; color: var(--soluk); }

.etiket { display: inline-block; padding: 0 .45rem; border-radius: 999px; font-size: .78rem; border: 1px solid var(--cizgi); }
.etiket.Riskli, .etiket.Blokeli { color: var(--borc); border-color: currentColor; }

.sayfalama { display: flex; gap: 1rem; justify-content: center; margin-top: 1rem; }

.bilgi { max-width: 560px; margin: 3rem auto; text-align: center; }
.mesaj { background: var(--serit); color: var(--serit-metin); padding: .6rem .9rem; border-radius: 8px; }

/* Giriş */
.giris { max-width: 380px; margin: 4rem auto; }
.giris form { display: flex; flex-direction: column; gap: .75rem; }
.giris label { display: flex; flex-direction: column; gap: .25rem; color: var(--soluk); font-size: .9rem; }

/* Rapor seçimi */
.rapor-listesi { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; }
.rapor-listesi a { color: var(--metin); }
.rapor-listesi a:hover { text-decoration: none; border-color: var(--vurgu); }
.rapor-listesi .kart span { display: block; color: var(--soluk); font-size: .85rem; }

/* Dar ekran: tablo satırları kart olur */
@media (max-width: 640px) {
    .ust-ic { gap: .5rem; }
    .menu { order: 3; flex-basis: 100%; }
    .liste thead { display: none; }
    .liste, .liste tbody, .liste tfoot, .liste tr, .liste td { display: block; width: 100%; }
    .liste tr { border-bottom: 1px solid var(--cizgi); padding: .5rem 0; }
    .liste td { border: 0; padding: .2rem .75rem; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
    .liste td.sayi { text-align: right !important; }
    .liste td::before { content: attr(data-etiket); color: var(--soluk); text-align: left; font-size: .85rem; }
    .liste td:not([data-etiket])::before { content: none; }
}

@media print {
    .ust, .serit, .filtre, .sayfalama, .alt { display: none; }
    body { background: #fff; color: #000; }
    .tablo-kap, .kart { border: 0; box-shadow: none; }
    a { color: inherit; }
}
