* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, "Segoe UI", sans-serif; color: #1d2733;
  /* Kahve ve bitki çayı teması: sıcak krem zemin + soluk çekirdek/yaprak/papatya deseni (static/desen.svg; CSP yalnızca kendi dosyalarımıza izin verir) */
  background-color: #f4f1ec;
  background-image: url("desen.svg");
  background-size: 180px 180px; }
main { max-width: 1000px; margin: 24px auto; padding: 0 16px; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.ust { display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: #1f3a5f; color: #fff; }
.ust form { margin: 0; }
.bosluk { flex: 1; }

/* Üst menü */
.menu { display: flex; flex-wrap: wrap; gap: 8px; padding: 9px 14px; background: #fff; border-bottom: 1px solid #dde3ea; position: relative; z-index: 10; }
.menu { align-items: center; }
.menu .oge { position: relative; }
/* Ana Sayfa ve modül düğmeleri aynı görünüm ve animasyonu paylaşır */
.menu .ana, .menu .dugme { display: inline-flex; align-items: center; gap: 7px; padding: 7px 15px; background: linear-gradient(135deg, #5589d6, #3d6cb5); color: #fff; font: inherit; font-weight: 600; text-decoration: none; border: 0; border-radius: 999px; box-shadow: 0 1px 4px rgba(40, 80, 140, .25); cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s; }
.menu .ana:hover, .menu .dugme:hover { transform: translateY(-1px); background: linear-gradient(135deg, #4f82cf, #3763ab); box-shadow: 0 3px 8px rgba(40, 80, 140, .3); }
.menu .ana.aktif, .menu .oge.aktif > .dugme, .menu .oge.acik > .dugme { box-shadow: 0 0 0 3px #d5e2f4, 0 1px 4px rgba(40, 80, 140, .25); }
.menu .ok { font-size: 11px; opacity: .85; }
.menu .alt { position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px; background: #f0f8f8; border: 1px solid #cfe5e4; border-radius: 14px; box-shadow: 0 8px 20px rgba(20, 60, 80, .14); padding: 8px; }
.menu .alt[hidden] { display: none; }
.menu .alt:not([hidden]) { display: flex; flex-direction: column; gap: 6px; }
/* Açılan alt başlıklar: ana düğmelerle aynı şekil; maviye komşu yumuşak turkuaz (soft teal), koyu lacivert yazı */
.menu .alt a { display: block; padding: 7px 15px; background: #d8eeed; color: #17406b; font-weight: 500; text-decoration: none; border: 1px solid #bfe0de; border-radius: 999px; transition: transform .12s, box-shadow .12s, background .12s, border-color .12s; }
.menu .alt a:hover, .menu .alt a:focus-visible { transform: translateY(-1px); background: #c3e6e4; border-color: #8fcac7; box-shadow: 0 3px 8px rgba(20, 100, 110, .18); outline: none; }
.iz { margin: 0 0 8px; }
@media (max-width: 700px) {
  .menu { padding: 8px 8px; gap: 6px; }
  .menu .alt { position: absolute; max-width: 90vw; }
}
.kart { background: #fff; border: 1px solid #dde3ea; border-radius: 8px; padding: 18px; margin-bottom: 16px; overflow-x: auto; }
.giris { max-width: 360px; margin: 12vh auto 0; }
label { display: block; margin-bottom: 12px; font-size: 13px; color: #4a5766; }
input, select { width: 100%; padding: 8px 10px; border: 1px solid #c3ccd6; border-radius: 6px; font: inherit; margin-top: 4px; }
button { padding: 8px 14px; border: 0; border-radius: 6px; background: #1f6feb; color: #fff; font: inherit; cursor: pointer; }
button.ikincil { background: #e6ebf1; color: #1d2733; }
.satir { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
.satir input, .satir select { width: auto; flex: 1; min-width: 140px; margin-top: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid #e8ecf1; vertical-align: middle; }
th { font-size: 12px; color: #637083; font-weight: 600; }
.soluk { color: #6b7785; font-size: 13px; }
.mesaj { padding: 10px 12px; border-radius: 6px; margin-bottom: 12px; }
.mesaj.hata { background: #fde8e8; color: #8a1f1f; }
.mesaj.tamam { background: #e3f4e6; color: #1e5a2b; }

/* ---------- Ana sayfa özeti ---------- */
main { max-width: 1240px; }
.oz-ust { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.oz-ust h1 { margin: 0; }
.oz-ust p { margin: 2px 0 0; }
.oz-donem { display: inline-flex; padding: 4px; background: #e6ebf1; border-radius: 999px; gap: 2px; }
.oz-donem a { padding: 6px 16px; border-radius: 999px; color: #1d2733; text-decoration: none; font-weight: 600; transition: background .12s; }
.oz-donem a:hover { background: #d7dfe9; }
.oz-donem a.aktif { background: linear-gradient(135deg, #2f80ff, #1558d6); color: #fff; box-shadow: 0 2px 6px rgba(31, 111, 235, .35); }
.mesaj.bilgi { background: #e8f1fe; color: #1b4a8a; }

.oz-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.oz-kpi.dort .kart, .oz-kpi .kart { margin-bottom: 0; }
.oz-hero { grid-column: span 2; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.oz-hero-deger { font-size: 52px; line-height: 1.1; font-weight: 700; letter-spacing: -.5px; }
.oz-etiket { font-size: 13px; color: #637083; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.oz-deger { font-size: 28px; font-weight: 700; line-height: 1.2; margin: 4px 0; }
.oz-fark { font-size: 13px; font-weight: 600; }
.oz-fark span { font-weight: 400; color: #637083; }
.oz-fark.iyi { color: #006c10; }
.oz-fark.kotu, .kotu-yazi { color: #c4302f; }

.nokta { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.nokta.gelir { background: #257de0; }
.nokta.gider { background: #f47230; }
.nokta.net { background: #666; }

.oz-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.oz-grid .kart { margin-bottom: 0; }
.oz-grid.iki-bir { grid-template-columns: 2fr 1fr; }
.oz-grid.iki { grid-template-columns: 1fr 1fr; }
.oz-grid.uc { grid-template-columns: repeat(3, 1fr); }
.oz-baslik { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.oz-baslik h2 { margin: 0; }
.oz-aciklama { display: flex; gap: 14px; font-size: 13px; color: #4a5766; }
.oz-aciklama span { display: inline-flex; align-items: center; gap: 6px; }

.oz-grafik { width: 100%; height: auto; display: block; }
.oz-grafik .izgara { stroke: #e7e7e7; stroke-width: 1; }
.oz-grafik .izgara.taban { stroke: #c2c2c2; }
.oz-grafik .eksen { fill: #666; font-size: 11px; }
.oz-grafik .c-gelir { fill: #257de0; }
.oz-grafik .c-gider { fill: #f47230; }
.oz-grafik .hedef { outline: none; }
.oz-grafik .hedef:hover, .oz-grafik .hedef:focus { fill: rgba(31, 111, 235, .07); }
.oz-tablo { margin-top: 10px; font-size: 13px; }
.oz-tablo summary { cursor: pointer; color: #1558d6; font-weight: 600; }
.oz-tablo table { margin-top: 8px; }
.sag { text-align: right; }

.oz-bar { margin-bottom: 14px; }
.oz-bar:last-child { margin-bottom: 0; }
.oz-bar-ust { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; font-size: 14px; }
.oz-bar-ust span { color: #1d2733; }
.oz-bar-ust strong { font-weight: 600; white-space: nowrap; }
.oz-izge { display: block; }
.oz-izge .zemin { fill: #eef1f5; }
.oz-izge.gelir .zemin { fill: #dbe9fb; } .oz-izge.gelir .dolu { fill: #257de0; }
.oz-izge.gider .zemin { fill: #fde3d6; } .oz-izge.gider .dolu { fill: #f47230; }
.oz-izge.kritik .zemin { fill: #f8d7d8; } .oz-izge.kritik .dolu { fill: #dc3c3d; }
.oz-izge.uyari .zemin { fill: #fdeec3; } .oz-izge.uyari .dolu { fill: #fbb315; }

.oz-liste { list-style: none; margin: 0; padding: 0; }
.oz-liste li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #eef1f5; }
.oz-liste li:last-child { border-bottom: 0; }
.oz-liste li.toplam { border-top: 1px solid #c3ccd6; border-bottom: 0; margin-top: 2px; }
.oz-liste strong { white-space: nowrap; }
.oz-vade { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.oz-vade small { color: #637083; font-size: 12px; }
.rozet { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; }
.rozet.tahsilat { background: #dbe9fb; color: #1b4a8a; }
.rozet.odeme { background: #fde3d6; color: #8a3a12; }

.ipucu { position: fixed; z-index: 50; pointer-events: none; background: #fff; border: 1px solid #dde3ea; border-radius: 10px; box-shadow: 0 8px 20px rgba(20, 40, 70, .18); padding: 10px 12px; min-width: 190px; font-size: 13px; }
.ipucu[hidden] { display: none; }
.ipucu-baslik { font-weight: 700; margin-bottom: 6px; }
.ipucu-satir { display: flex; align-items: center; gap: 7px; padding: 2px 0; }
.ipucu-satir span { flex: 1; color: #4a5766; }

@media (max-width: 1000px) {
  .oz-kpi { grid-template-columns: 1fr 1fr; }
  .oz-grid.iki-bir, .oz-grid.iki, .oz-grid.uc { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .oz-kpi { grid-template-columns: 1fr; }
  .oz-hero { grid-column: span 1; }
  .oz-hero-deger { font-size: 40px; }
}

/* ---------- Cari (müşteri / tedarikçi) ---------- */
.btn { display: inline-block; padding: 8px 18px; border: 0; border-radius: 999px; background: linear-gradient(135deg, #2f80ff, #1558d6); color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; box-shadow: 0 2px 6px rgba(31, 111, 235, .35); transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(31, 111, 235, .45); }
.btn.ikincil { background: #e6ebf1; color: #1d2733; box-shadow: none; }
.btn.kucuk, button.kucuk { padding: 5px 12px; font-size: 13px; font-weight: 600; border-radius: 999px; }
.arama { margin-bottom: 14px; }
.arama input[type=search] { flex: 2; }
label.onay { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: #1d2733; font-size: 14px; }
label.onay input { width: auto; margin: 0; }
.cari-tablo a { color: #1d2733; text-decoration: none; }
.cari-tablo a:hover strong { color: #1558d6; }
.cari-tablo tr.pasif td { color: #8a95a3; }
.cari-tablo .bos { text-align: center; padding: 28px 8px; }
.islem { display: flex; gap: 6px; justify-content: flex-end; }
.islem form { margin: 0; }
.rozet.pasif { background: #e6ebf1; color: #4a5766; margin-left: 6px; }
.rozet.iki { background: #e3f4e6; color: #1e5a2b; margin-left: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin-top: 12px; }
.form-grid .genis { grid-column: span 2; }
.form-grid textarea { width: 100%; padding: 8px 10px; border: 1px solid #c3ccd6; border-radius: 6px; font: inherit; margin-top: 4px; resize: vertical; }
.turler { display: flex; gap: 18px; align-items: center; margin-bottom: 12px; }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } .form-grid .genis { grid-column: span 1; } }

.satir input[type=checkbox] { flex: none; min-width: 0; width: auto; }

/* Tutar okunuşu ve IBAN sayacı */
.okunus { display: block; min-height: 18px; margin-top: 4px; font-size: 12px; color: #1558d6; }
.iban-durum { display: block; margin-top: 4px; font-size: 12px; color: #637083; }
.iban-durum.hata { color: #c4302f; }
.iban-durum.tamam { color: #006c10; }

/* Giderler */
[hidden] { display: none !important; }
.filtre { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin-bottom: 8px; }
.filtre label { margin: 0; }
.filtre label.gen { flex: 1; min-width: 200px; }
.filtre input, .filtre select { width: auto; min-width: 130px; }
.filtre label.gen input { width: 100%; }
.filtre label.onay input { min-width: 0; }
.hizli { margin: 0 0 12px; }
.rozet.odendi, .rozet.tamam { background: #e3f4e6; color: #1e5a2b; }
.rozet.bekliyor { background: #fff0cf; color: #7a4a00; }
.tehlike { background: #fde8e8; color: #8a1f1f; margin-top: 16px; }
.tehlike:hover { background: #f9d3d3; }
.iptal-form { margin: 0; border-top: 1px solid #eef1f5; padding-top: 4px; }

/* Stok: gider/gelir formundaki ürün kalemleri */
fieldset.kalemler { border: 1px solid #d5dce4; border-radius: 8px; padding: 8px 14px 12px; margin: 4px 0 12px; }
fieldset.kalemler legend { font-weight: 700; padding: 0 6px; }
.kalem-tablo { width: 100%; border-collapse: collapse; }
.kalem-tablo th { font-size: 12px; text-align: left; padding: 4px 6px; color: #5a6676; }
.kalem-tablo th.sag { text-align: right; }
.kalem-tablo td { padding: 3px 6px; vertical-align: middle; }
.kalem-tablo select { width: 100%; }
.kalem-tablo input { width: 90px; text-align: right; }
.kalem-tablo [hidden] { display: none; }
.cari-tablo td input[name^="sayilan_"] { width: 110px; text-align: right; }

/* Cari ekstre */
.ekstre tr.devir td, .ekstre tr.toplam td { background: #f3f6fa; }
.ekstre tr.toplam td { border-top: 2px solid #c3ccd6; }
@media print {
  .ust, .menu, .filtre, .hizli, .islem, .iz { display: none !important; }
  body { background: #fff; }
  .kart { box-shadow: none; border: 0; }
}

/* Stok: çeşitli ürünler */
.form-grid .bolum { display: contents; }
.form-grid .bolum[hidden] { display: none; }
.tip-secimi { flex-wrap: wrap; }
.cesit-tablo input, .cesit-tablo select { width: 100%; min-width: 70px; }
.cesit-tablo input[name="c_secenek"] { min-width: 110px; }
.cesit-tablo td:first-child, .cesit-tablo th:first-child { width: 26%; }
.stok-tablo tr.grup-baslik td { background: #eef3f9; border-top: 2px solid #d5dce4; }
.stok-tablo tr.cesit td:first-child { padding-left: 28px; }
.stok-tablo tr.cesit td:first-child::before { content: "└"; color: #9aa6b4; margin-right: 6px; }
.cesit-tablo input[name="c_secenek"], .cesit-tablo input[name="c_kod"] { text-align: left; }

/* İndir (PDF / Excel) açılır menüsü: JS'siz çalışır, dışarı tıklayınca alanlar.js kapatır */
details.indir { position: relative; }
details.indir > summary { list-style: none; cursor: pointer; user-select: none; }
details.indir > summary::-webkit-details-marker { display: none; }
.indir-menu { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 140px; background: #fff;
  border: 1px solid #d5dce5; border-radius: 8px; box-shadow: 0 6px 18px rgba(20, 40, 70, .15); padding: 4px; display: flex; flex-direction: column; }
.indir-menu a { padding: 8px 12px; border-radius: 6px; color: #1d2733; text-decoration: none; font-weight: 600; }
.indir-menu a:hover, .indir-menu a:focus { background: #e8eef7; }

/* Ana sayfa: yakında tükenecek (akıllı stok) */
.tahmin-baslik { margin-top: 18px; padding-top: 12px; border-top: 1px dashed #d8d2c6; }

/* Yazdırırken firma üst bilgisi (Ayarlar > Firma Bilgileri); ekranda gizli */
.yazdir-baslik { display: none; }
@media print {
  .yazdir-baslik { display: block; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid #999; font-size: 12px; line-height: 1.4; }
  .yazdir-baslik strong { font-size: 16px; }
}

/* Veri aktarma */
.adim-liste { margin: 0 0 8px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.adim-liste input[type=file] { max-width: 100%; }
.satir { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Ekstre paylaşım bağlantısı */
.paylas-kart { margin-top: 1rem; }
.paylas-url { width: 100%; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; margin: .5rem 0 1rem; }

/* Hesabım / iki adımlı doğrulama */
.hesabim-link { color: inherit; margin-right: .75rem; text-decoration: none; opacity: .85; }
.hesabim-link:hover { text-decoration: underline; opacity: 1; }
.qr { margin: .75rem 0; }
.qr svg { width: 200px; height: 200px; border: 1px solid #d9d4cb; border-radius: 6px; }
.anahtar { font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; user-select: all; }
