:root {
  --bg: #f4f5f3;
  --kart: #ffffff;
  --yazi: #1d2321;
  --soluk: #6b7571;
  --cizgi: #e2e5e2;
  --ana: #1f4e46;
  --ana-acik: #e3eeeb;
  --gider: #b23a2e;
  --gider-acik: #fbeceA;
  --giris: #1c7a4a;
  --giris-acik: #e4f3ea;
  --uyari: #a86a00;
  --golge: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  --r: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121615;
    --kart: #1b201f;
    --yazi: #e7ebe9;
    --soluk: #97a19d;
    --cizgi: #2b3230;
    --ana: #5fb3a2;
    --ana-acik: #1f2e2b;
    --gider: #f08a7e;
    --gider-acik: #3a2321;
    --giris: #6fcf97;
    --giris-acik: #1d3326;
    --uyari: #e3b34f;
    --golge: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--yazi);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--ana); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.yukleniyor { padding: 40vh 0; text-align: center; color: var(--soluk); }

/* ---- Yerleşim ---- */
.kabuk { display: flex; min-height: 100vh; }
.yan {
  width: 220px; flex: none; background: var(--kart); border-right: 1px solid var(--cizgi);
  padding: 20px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px;
}
.marka { font-weight: 700; font-size: 17px; padding: 4px 12px 18px; display: flex; align-items: center; gap: 8px; }
.marka i { width: 26px; height: 26px; border-radius: 7px; background: var(--ana); display: inline-block; }
.yan a { padding: 10px 12px; border-radius: 9px; color: var(--yazi); display: flex; gap: 10px; align-items: center; }
.yan a.aktif { background: var(--ana-acik); color: var(--ana); font-weight: 600; }
.yan a:hover:not(.aktif) { background: var(--bg); }
.yan .alt { margin-top: auto; font-size: 13px; color: var(--soluk); padding: 0 12px; }
.ic { flex: 1; min-width: 0; padding: 24px 28px 100px; max-width: 1100px; }
.alt-menu { display: none; }

@media (max-width: 760px) {
  .yan { display: none; }
  .ic { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  .alt-menu {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--kart); border-top: 1px solid var(--cizgi); padding-bottom: env(safe-area-inset-bottom);
  }
  .alt-menu a { flex: 1; text-align: center; padding: 8px 0 7px; font-size: 11px; color: var(--soluk); display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .alt-menu a.aktif { color: var(--ana); font-weight: 600; }
}
.ikon { width: 20px; height: 20px; flex: none; }

/* ---- Başlık ---- */
.baslik { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.baslik h1 { font-size: 22px; margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.baslik .geri { color: var(--soluk); font-size: 14px; display: block; margin-bottom: 2px; }
h2 { font-size: 16px; margin: 26px 0 10px; }
h2:first-child { margin-top: 0; }

/* ---- Kartlar ---- */
.kart { background: var(--kart); border-radius: var(--r); box-shadow: var(--golge); border: 1px solid var(--cizgi); padding: 16px; }
.kart + .kart { margin-top: 12px; }
.ozetler { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.ozet .etiket { font-size: 13px; color: var(--soluk); }
.ozet .deger { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ozet.buyuk { grid-column: 1 / -1; background: var(--ana); color: #fff; border-color: transparent; }
.ozet.buyuk .etiket { color: rgba(255,255,255,.75); }
.ozet.buyuk .deger { font-size: 30px; }
@media (prefers-color-scheme: dark) { .ozet.buyuk { background: #24433d; } }
.ozet .alt-yazi { font-size: 12px; color: var(--soluk); margin-top: 4px; }
.ozet.buyuk .alt-yazi { color: rgba(255,255,255,.75); }

.gider-renk { color: var(--gider); }
.giris-renk { color: var(--giris); }
.sayi { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- Listeler ---- */
.liste { background: var(--kart); border-radius: var(--r); border: 1px solid var(--cizgi); box-shadow: var(--golge); overflow: hidden; }
.satir { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--cizgi); cursor: pointer; }
.satir:first-child { border-top: 0; }
.satir:hover { background: var(--bg); }
.satir .orta { flex: 1; min-width: 0; }
.satir .ust { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.satir .alt { font-size: 13px; color: var(--soluk); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.satir .sag { text-align: right; font-weight: 600; }
.satir .sag small { display: block; font-weight: 400; color: var(--soluk); font-size: 12px; }
.tur-nokta { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.tur-nokta.gider { background: var(--gider-acik); color: var(--gider); }
.tur-nokta.giris { background: var(--giris-acik); color: var(--giris); }
.gun-baslik { padding: 8px 16px; font-size: 12px; color: var(--soluk); background: var(--bg); border-top: 1px solid var(--cizgi); font-weight: 600; display: flex; justify-content: space-between; }
.gun-baslik:first-child { border-top: 0; }
.bos { padding: 28px 16px; text-align: center; color: var(--soluk); }

.rozet { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--bg); color: var(--soluk); font-weight: 600; vertical-align: middle; }
.rozet.devam { background: var(--ana-acik); color: var(--ana); }
.rozet.satildi { background: var(--giris-acik); color: var(--giris); }
.rozet.opsiyon { background: #fff3d6; color: var(--uyari); }
@media (prefers-color-scheme: dark) { .rozet.opsiyon { background: #3a3020; } }

/* ---- Çubuklar ---- */
.cubuk-satir { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: 10px; align-items: center; padding: 7px 0; font-size: 14px; }
.cubuk-satir .ad { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cubuk { height: 8px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.cubuk i { display: block; height: 100%; background: var(--ana); border-radius: 99px; }
.ilerleme { height: 6px; background: var(--bg); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.ilerleme i { display: block; height: 100%; background: var(--giris); }

.grafik { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.grafik .ay { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; min-width: 0; }
.grafik .ciftler { display: flex; gap: 2px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.grafik .ciftler i { width: 40%; max-width: 16px; border-radius: 3px 3px 0 0; min-height: 1px; }
.grafik .g1 { background: var(--giris); }
.grafik .g2 { background: var(--gider); }
.grafik small { font-size: 11px; color: var(--soluk); }
.lejant { display: flex; gap: 14px; font-size: 12px; color: var(--soluk); margin-top: 8px; }
.lejant span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; background: var(--c); }

/* ---- Düğmeler ---- */
.btn {
  border: 1px solid var(--cizgi); background: var(--kart); padding: 9px 14px; border-radius: 9px; cursor: pointer;
  font-weight: 600; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; min-height: 40px;
}
.btn:hover { border-color: var(--soluk); }
.btn.ana { background: var(--ana); border-color: var(--ana); color: #fff; }
@media (prefers-color-scheme: dark) { .btn.ana { color: #0d1513; } }
.btn.tehlike { color: var(--gider); }
.btn.kucuk { padding: 5px 10px; min-height: 32px; font-size: 13px; }
.btn:disabled { opacity: .6; cursor: default; }
.btnlar { display: flex; gap: 8px; flex-wrap: wrap; }
.ekle-fab {
  position: fixed; right: 20px; bottom: 24px; z-index: 25; width: 56px; height: 56px; border-radius: 50%;
  background: var(--ana); color: #fff; border: 0; font-size: 30px; line-height: 1; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); display: grid; place-items: center;
}
@media (prefers-color-scheme: dark) { .ekle-fab { color: #0d1513; } }
@media (max-width: 760px) { .ekle-fab { bottom: calc(74px + env(safe-area-inset-bottom)); right: 16px; } }

/* ---- Sekmeler ---- */
.sekmeler { display: flex; gap: 4px; border-bottom: 1px solid var(--cizgi); margin: 18px 0 16px; overflow-x: auto; scrollbar-width: none; }
.sekmeler::-webkit-scrollbar { display: none; }
.sekmeler button { border: 0; background: none; padding: 10px 12px; cursor: pointer; color: var(--soluk); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.sekmeler button.aktif { color: var(--ana); border-bottom-color: var(--ana); }

/* ---- Formlar ---- */
.alan { display: block; margin-bottom: 12px; }
.alan > span { display: block; font-size: 13px; color: var(--soluk); margin-bottom: 4px; font-weight: 600; }
.alan input, .alan select, .alan textarea, .filtre input, .filtre select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--cizgi); border-radius: 9px; background: var(--kart); min-height: 42px;
}
.alan textarea { min-height: 80px; resize: vertical; }
.alan input:focus, .alan select:focus, .alan textarea:focus, .filtre input:focus, .filtre select:focus { outline: 2px solid var(--ana); outline-offset: -1px; border-color: transparent; }
.alan input.tutar-gir { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.iki { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 480px) { .iki { grid-template-columns: 1fr; } }
.secici { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); padding: 4px; border-radius: 10px; margin-bottom: 14px; gap: 4px; }
.secici button { border: 0; background: none; padding: 9px; border-radius: 7px; cursor: pointer; font-weight: 700; color: var(--soluk); }
.secici button.aktif.gider { background: var(--kart); color: var(--gider); box-shadow: var(--golge); }
.secici button.aktif.giris { background: var(--kart); color: var(--giris); box-shadow: var(--golge); }
.onay { display: flex; gap: 8px; align-items: center; font-size: 14px; margin-bottom: 14px; }

.filtre { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 8px; margin-bottom: 12px; }
@media (max-width: 900px) { .filtre { grid-template-columns: 1fr 1fr; } .filtre .ara { grid-column: 1 / -1; } }
.filtre-ozet { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; margin-bottom: 12px; color: var(--soluk); }
.filtre-ozet b { color: var(--yazi); }

/* ---- Modal ---- */
.modal-arka { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; animation: belir .12s; }
.modal { background: var(--kart); border-radius: 16px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; padding: 20px; }
.modal h3 { margin: 0 0 16px; font-size: 18px; display: flex; justify-content: space-between; align-items: center; }
.modal h3 button { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--soluk); padding: 0 4px; }
.modal .alt-btn { display: flex; gap: 8px; margin-top: 18px; }
.modal .alt-btn .bosluk { flex: 1; }
@media (max-width: 560px) {
  .modal-arka { align-items: flex-end; padding: 0; }
  .modal { border-radius: 16px 16px 0 0; max-height: 92vh; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
@keyframes belir { from { opacity: 0; } }

#bildirim { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
#bildirim div { background: #222; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.25); max-width: 90vw; }
#bildirim div.hata { background: var(--gider); }

/* ---- Giriş ---- */
.giris-ekran { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.giris-ekran .kart { width: 100%; max-width: 360px; padding: 26px; }
.giris-ekran h1 { margin: 0 0 4px; font-size: 22px; }
.giris-ekran p { margin: 0 0 20px; color: var(--soluk); font-size: 14px; }
.giris-ekran .btn { width: 100%; justify-content: center; }
.hata-yazi { color: var(--gider); font-size: 14px; margin-bottom: 12px; }

.bilgi-tablo { width: 100%; border-collapse: collapse; }
.bilgi-tablo td { padding: 9px 0; border-top: 1px solid var(--cizgi); vertical-align: top; }
.bilgi-tablo tr:first-child td { border-top: 0; }
.bilgi-tablo td:first-child { color: var(--soluk); width: 40%; padding-right: 12px; }
.bilgi-tablo td:last-child { text-align: right; white-space: nowrap; }
.notlar { white-space: pre-wrap; color: var(--soluk); font-size: 14px; }
.ara-cubuk { display: flex; gap: 8px; margin-bottom: 12px; }
.ara-cubuk input { flex: 1; padding: 10px 12px; border: 1px solid var(--cizgi); border-radius: 9px; background: var(--kart); min-height: 42px; }
.izgara { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.proje-kart { cursor: pointer; }
.proje-kart:hover { border-color: var(--soluk); }
.proje-kart .ust { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.proje-kart h3 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.proje-kart .tutar { font-size: 22px; font-weight: 700; margin-top: 10px; }
.proje-kart .kucuk { color: var(--soluk); font-size: 13px; }

/* ---- Bekleyen işlemler / çevrimdışı ---- */
.kuyruk-bant {
  display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: #fff3d6; color: #5c3d00; border: 1px solid #f0d58c; border-radius: var(--r); padding: 12px 14px; margin-bottom: 16px;
}
.kuyruk-bant small { display: block; font-size: 13px; opacity: .85; margin-top: 2px; }
.kuyruk-bant.hatali { background: var(--gider-acik); color: var(--gider); border-color: var(--gider); }
.kuyruk-bant.cevrimdisi { background: var(--bg); color: var(--yazi); border-color: var(--cizgi); }
.kuyruk-bant .btn:not(.ana) { background: rgba(255,255,255,.6); }
@media (prefers-color-scheme: dark) {
  .kuyruk-bant { background: #3a3020; color: #f3d48c; border-color: #5a4a26; }
  .kuyruk-bant .btn:not(.ana) { background: transparent; }
}
