/* Gördit Ön Muhasebe — müşteri uygulaması (telefon / tablet / masaüstü). Telefon öncelikli tasarım. */
:root {
  --birincil: #2f8f3a;
  --birincil-koyu: #23702c;
  --birincil-acik: #e8f5e9;
  --tehlike: #d32f2f;
  --tehlike-acik: #fdecea;
  --uyari: #b26a00;
  --zemin: #f3f5f7;
  --kart: #ffffff;
  --yazi: #1b2330;
  --yazi-2: #5b6573;
  --cizgi: #e3e7ec;
  --golge: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --yaricap: 12px;
  --ust-yukseklik: 56px;
  --alt-yukseklik: 64px;
  --guvenli-alt: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --birincil: #4caf50;
    --birincil-koyu: #66bb6a;
    --birincil-acik: #1d3320;
    --tehlike: #ef5350;
    --tehlike-acik: #3a1d1d;
    --uyari: #ffb74d;
    --zemin: #0f1419;
    --kart: #1a2129;
    --yazi: #e6e9ed;
    --yazi-2: #9aa4b1;
    --cizgi: #2a333d;
    --golge: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--zemin); color: var(--yazi); font-size: 15px; line-height: 1.45;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: contain;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--birincil); }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; flex-shrink: 0; }

/* ---------- Giriş ---------- */
.giris { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.giris-kutu { width: 100%; max-width: 380px; background: var(--kart); border-radius: 16px; padding: 28px 22px; box-shadow: var(--golge); border: 1px solid var(--cizgi); }
.giris-kutu img { display: block; height: 64px; margin: 0 auto 10px; }
.giris-kutu h1 { font-size: 20px; text-align: center; margin: 0 0 4px; }
.giris-kutu p.alt { text-align: center; color: var(--yazi-2); margin: 0 0 20px; font-size: 14px; }

/* ---------- Yerleşim ---------- */
.ust {
  position: sticky; top: 0; z-index: 30; height: calc(var(--ust-yukseklik) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px); background: var(--kart); border-bottom: 1px solid var(--cizgi);
  display: flex; align-items: center; gap: 4px; padding-left: 4px; padding-right: 8px;
}
.ust h2 { flex: 1; font-size: 17px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 8px; }
.ust .ikon-btn { width: 44px; height: 44px; }
.icerik { padding: 14px 14px calc(var(--alt-yukseklik) + var(--guvenli-alt) + 24px); max-width: 980px; margin: 0 auto; }
.alt-menu {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--kart); border-top: 1px solid var(--cizgi);
  display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--alt-yukseklik) + var(--guvenli-alt)); padding-bottom: var(--guvenli-alt);
}
.alt-menu a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--yazi-2); font-size: 11.5px; font-weight: 600; }
.alt-menu a svg { width: 24px; height: 24px; }
.alt-menu a.aktif { color: var(--birincil); }
.yan-menu { display: none; }

@media (min-width: 900px) {
  .alt-menu { display: none; }
  .yan-menu {
    display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: 240px; background: var(--kart);
    border-right: 1px solid var(--cizgi); padding: 16px 10px; gap: 2px; overflow-y: auto; z-index: 31;
  }
  .yan-menu .marka { display: flex; align-items: center; gap: 10px; padding: 6px 10px 16px; font-weight: 700; }
  .yan-menu .marka img { height: 30px; }
  .yan-menu a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--yazi); font-weight: 500; }
  .yan-menu a svg { width: 20px; height: 20px; color: var(--yazi-2); }
  .yan-menu a.aktif { background: var(--birincil-acik); color: var(--birincil-koyu); font-weight: 600; }
  .yan-menu a.aktif svg { color: var(--birincil); }
  .yan-menu .alt { margin-top: auto; font-size: 12px; color: var(--yazi-2); padding: 10px 12px; }
  .ana { margin-left: 240px; }
  .icerik { padding: 20px 24px 40px; }
}

/* ---------- Bileşenler ---------- */
.kart { background: var(--kart); border: 1px solid var(--cizgi); border-radius: var(--yaricap); box-shadow: var(--golge); }
.kart + .kart, .bolum + .bolum { margin-top: 12px; }
.kart-ic { padding: 14px; }
.baslik-satir { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 2px 8px; }
.baslik-satir h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--yazi-2); margin: 0; }
.ozet-izgara { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .ozet-izgara { grid-template-columns: repeat(3, 1fr); } }
.ozet { padding: 12px 14px; }
.ozet .etiket { font-size: 12.5px; color: var(--yazi-2); }
.ozet .deger { font-size: 19px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.hizli-izgara { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hizli-izgara a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; text-decoration: none; color: var(--yazi); font-size: 12.5px; font-weight: 600; text-align: center; }
.hizli-izgara a span.daire { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--birincil-acik); color: var(--birincil); }
.hizli-izgara a svg { width: 22px; height: 22px; }

.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { border-top: 1px solid var(--cizgi); }
.liste > li:first-child { border-top: 0; }
.liste .oge { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 60px; text-decoration: none; color: inherit; width: 100%; background: none; border: 0; text-align: left; cursor: pointer; }
.liste .oge:active { background: var(--zemin); }
.oge .orta { flex: 1; min-width: 0; }
.oge .ad { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oge .alt-yazi { font-size: 13px; color: var(--yazi-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oge .sag { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.oge .sag small { display: block; font-weight: 400; color: var(--yazi-2); font-size: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; flex-shrink: 0; background: var(--birincil-acik); color: var(--birincil-koyu); }
.bos { padding: 28px 16px; text-align: center; color: var(--yazi-2); }

.arti { color: var(--birincil); }
.eksi { color: var(--tehlike); }
.rozet { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--zemin); color: var(--yazi-2); border: 1px solid var(--cizgi); }
.rozet.yesil { background: var(--birincil-acik); color: var(--birincil-koyu); border-color: transparent; }
.rozet.kirmizi { background: var(--tehlike-acik); color: var(--tehlike); border-color: transparent; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--cizgi); background: var(--kart); font-weight: 600; cursor: pointer; text-decoration: none; color: var(--yazi); }
.btn svg { width: 20px; height: 20px; }
.btn.birincil { background: var(--birincil); border-color: var(--birincil); color: #fff; }
.btn.tehlike { color: var(--tehlike); border-color: var(--tehlike); background: transparent; }
.btn.tam { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.birincil:disabled { opacity: 1; background: #a5cfa9; border-color: #a5cfa9; }
@media (prefers-color-scheme: dark) { .btn.birincil:disabled { background: #2d4a30; border-color: #2d4a30; color: #9aa4b1; } }
.btn-satir { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-satir > .btn { flex: 1 1 140px; }
.ikon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; color: var(--yazi); flex-shrink: 0; }
.ikon-btn:active { background: var(--zemin); }
.ikon-btn svg { width: 22px; height: 22px; }
.yuzen { position: fixed; right: 16px; bottom: calc(var(--alt-yukseklik) + var(--guvenli-alt) + 16px); z-index: 25; width: 56px; height: 56px; border-radius: 16px; border: 0; background: var(--birincil); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.25); display: grid; place-items: center; cursor: pointer; }
.yuzen svg { width: 26px; height: 26px; }
@media (min-width: 900px) { .yuzen { bottom: 24px; right: 24px; } }

/* ---------- Form ---------- */
.alan { margin-bottom: 14px; }
.alan label { display: block; font-size: 13px; font-weight: 600; color: var(--yazi-2); margin-bottom: 6px; }
.girdi, select.girdi, textarea.girdi {
  width: 100%; min-height: 46px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--cizgi); background: var(--kart);
  font-size: 16px; /* iOS yakınlaştırmasın */ outline: none; appearance: none; -webkit-appearance: none;
}
select.girdi { background-image: linear-gradient(45deg, transparent 50%, var(--yazi-2) 50%), linear-gradient(135deg, var(--yazi-2) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
textarea.girdi { min-height: 80px; resize: vertical; }
.girdi:focus { border-color: var(--birincil); box-shadow: 0 0 0 3px var(--birincil-acik); }
.girdi.tutar { font-size: 22px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.iki-sutun { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.iki-sutun .alan { margin-bottom: 14px; }
.iki-sutun > * { min-width: 0; }
input.girdi[type=date] { min-width: 0; max-width: 100%; display: block; }
input.girdi[type=date]::-webkit-date-and-time-value { text-align: left; }
.ara-kutu { position: sticky; top: calc(var(--ust-yukseklik) + env(safe-area-inset-top, 0px)); z-index: 20; background: var(--zemin); padding: 2px 0 10px; display: flex; gap: 8px; }
.ara-kutu .girdi { flex: 1; padding-left: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%238a94a3' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 12px 50%; }
.pencere .ara-kutu { position: static; background: none; }
.ara-kutu .ikon-btn { width: 46px; height: 46px; border-radius: 10px; background: var(--kart); border: 1px solid var(--cizgi); }
.secim-grup { display: flex; gap: 6px; background: var(--zemin); padding: 4px; border-radius: 12px; border: 1px solid var(--cizgi); }
.secim-grup button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; font-weight: 600; color: var(--yazi-2); cursor: pointer; }
.secim-grup button.secili { background: var(--kart); color: var(--yazi); box-shadow: var(--golge); }
.secici-alan { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 50px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--cizgi); background: var(--kart); text-align: left; cursor: pointer; }
.secici-alan .orta { flex: 1; min-width: 0; }
.secici-alan > svg { color: var(--yazi-2); }
.secici-alan .bos-yazi { color: var(--yazi-2); }

/* ---------- Belge satırları ---------- */
.satir-oge { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--cizgi); }
.satir-oge:first-child { border-top: 0; }
.adet { display: inline-flex; align-items: center; border: 1px solid var(--cizgi); border-radius: 10px; overflow: hidden; }
.adet button { width: 36px; height: 36px; border: 0; background: var(--zemin); font-size: 20px; cursor: pointer; }
.adet span { min-width: 44px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.toplamlar { padding: 12px 14px; display: grid; gap: 6px; }
.toplamlar div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.toplamlar .genel { font-size: 19px; font-weight: 700; border-top: 1px solid var(--cizgi); padding-top: 8px; margin-top: 2px; }
.alt-cubuk { position: sticky; bottom: calc(var(--alt-yukseklik) + var(--guvenli-alt) + 8px); z-index: 15; margin-top: 14px; }
@media (min-width: 900px) { .alt-cubuk { bottom: 12px; } }
.alt-cubuk .btn { box-shadow: 0 4px 12px rgba(0,0,0,.15); min-height: 52px; font-size: 16px; }

/* ---------- Tablo (raporlar) ---------- */
.tablo-kap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tablo { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.tablo th, .tablo td { padding: 9px 12px; border-bottom: 1px solid var(--cizgi); text-align: left; white-space: nowrap; }
.tablo th { position: sticky; top: 0; background: var(--kart); font-size: 12px; color: var(--yazi-2); text-transform: uppercase; letter-spacing: .03em; }
.tablo td.sayi, .tablo th.sayi { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Detay ---------- */
.detay-bas { text-align: center; padding: 18px 14px 14px; }
.detay-bas .avatar { width: 56px; height: 56px; font-size: 20px; margin: 0 auto 8px; }
.detay-bas h3 { margin: 0; font-size: 18px; }
.detay-bas .bakiye { font-size: 26px; font-weight: 800; margin-top: 8px; font-variant-numeric: tabular-nums; }
.eylemler { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 10px 14px; }
.eylemler a, .eylemler button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--birincil); text-decoration: none; background: none; border: 0; cursor: pointer; padding: 6px 2px; }
.eylemler svg { width: 22px; height: 22px; }
.bilgi-satir { display: flex; justify-content: space-between; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--cizgi); }
.bilgi-satir:first-child { border-top: 0; }
.bilgi-satir span:first-child { color: var(--yazi-2); }
.bilgi-satir span:last-child { text-align: right; font-weight: 500; word-break: break-word; }

/* ---------- Grafik ---------- */
.cubuklar { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding: 10px 14px 0; }
.cubuklar .c { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.cubuklar .c i { display: block; width: 100%; max-width: 38px; background: var(--birincil); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.cubuklar .c.bu i { background: var(--birincil-koyu); }
.cubuk-etiket { display: flex; gap: 8px; padding: 6px 14px 12px; }
.cubuk-etiket span { flex: 1; text-align: center; font-size: 11.5px; color: var(--yazi-2); }

/* ---------- Alt pencere (sheet) ---------- */
.perde { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: belir .15s ease; }
.pencere { background: var(--kart); width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; padding-bottom: var(--guvenli-alt); animation: yuksel .2s ease; }
@media (min-width: 700px) { .perde { align-items: center; } .pencere { border-radius: 16px; max-height: 85vh; } }
.pencere-bas { display: flex; align-items: center; gap: 6px; padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--cizgi); }
.pencere-bas h3 { flex: 1; margin: 0; font-size: 17px; }
.pencere-ic { overflow-y: auto; padding: 14px 16px; -webkit-overflow-scrolling: touch; }
.pencere-ic.liste-mod { padding: 0; }
.pencere-alt { padding: 10px 16px 14px; border-top: 1px solid var(--cizgi); display: flex; gap: 8px; }
.pencere-alt .btn { flex: 1; }
@keyframes belir { from { opacity: 0; } }
@keyframes yuksel { from { transform: translateY(30px); opacity: .6; } }

/* ---------- Bildirim ---------- */
.bildirim { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--alt-yukseklik) + var(--guvenli-alt) + 20px); z-index: 60; background: #263238; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14.5px; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25); animation: belir .2s ease; }
.bildirim.hata { background: var(--tehlike); }
.bildirim.basari { background: var(--birincil-koyu); }
@media (min-width: 900px) { .bildirim { bottom: 28px; } }
.yukleniyor { display: flex; justify-content: center; padding: 36px; }
.yukleniyor::after { content: ""; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--cizgi); border-top-color: var(--birincil); animation: don .8s linear infinite; }
@keyframes don { to { transform: rotate(360deg); } }
.uyari-kutu { background: var(--tehlike-acik); color: var(--tehlike); padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }
.bilgi-kutu { background: var(--birincil-acik); color: var(--birincil-koyu); padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-bottom: 12px; }

/* ---------- Kamera ---------- */
.kamera { position: fixed; inset: 0; z-index: 70; background: #000; display: flex; flex-direction: column; }
.kamera video { flex: 1; width: 100%; object-fit: cover; }
.kamera .cerceve { position: absolute; left: 10%; right: 10%; top: 35%; height: 22%; border: 3px solid rgba(255,255,255,.85); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(0,0,0,.35); pointer-events: none; }
.kamera .kapat { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; background: rgba(0,0,0,.5); color: #fff; }
.kamera .ipucu { position: absolute; bottom: calc(30px + var(--guvenli-alt)); left: 0; right: 0; text-align: center; color: #fff; font-size: 15px; }
.menu-izgara .oge svg { width: 22px; height: 22px; color: var(--birincil); }
.yazdir-gizle { }
@media print { .ust, .alt-menu, .yan-menu, .yuzen, .alt-cubuk, .yazdir-gizle { display: none !important; } .ana { margin: 0; } body { background: #fff; } }
