:root {
    --bg: #1a1a1a;
    --card: #242424;
    --card2: #2b2b2b;
    --border: #3a3a3a;
    --text: #e8e8e8;
    --text-dim: #9a9a9a;
    --accent: #1f6aa5;
    --accent-hover: #14547f;
    --green: #2bc971;
    --red: #e05555;
    --orange: #c98a2b;
    --blue2: #2b8fc9;
}

[data-theme="light"] {
    --bg: #f5f5f7;
    --card: #ffffff;
    --card2: #f0f0f3;
    --border: #e2e2e6;
    --text: #1a1a1a;
    --text-dim: #6b6b70;
    --accent: #1f6aa5;
    --accent-hover: #175683;
    --green: #1a9c58;
    --red: #d1373f;
    --orange: #b5751f;
    --blue2: #1f6aa5;
}

body { transition: background 0.15s ease, color 0.15s ease; }
* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    padding-bottom: 78px; /* alt nav için boşluk */
}

a { color: inherit; text-decoration: none; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.topbar-baslik { font-size: 18px; font-weight: 700; }
.topbar-sag { display: flex; align-items: center; gap: 10px; }
.topbar-kullanici { font-size: 12px; color: var(--text-dim); }

.tema-buton {
    background: var(--card2); border: 1px solid var(--border); border-radius: 8px;
    width: 32px; height: 32px; cursor: pointer; font-size: 14px; flex-shrink: 0;
}
.tema-ikon-acik { display: none; }
[data-theme="light"] .tema-ikon-koyu { display: none; }
[data-theme="light"] .tema-ikon-acik { display: inline; }

.tema-buton-sabit {
    position: fixed;
    top: 14px; right: 14px;
    z-index: 50;
}

.icerik { padding: 16px; max-width: 640px; margin: 0 auto; }

/* --- alt navigasyon --- */
.alt-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--card);
    border-top: 1px solid var(--border);
    display: flex;
    overflow-x: auto;
    padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
    z-index: 10;
}
.alt-nav a {
    flex: 1 0 auto;
    min-width: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    font-size: 10px;
    color: var(--text-dim);
    border-radius: 10px;
}
.alt-nav a.aktif { color: var(--accent); background: rgba(31,106,165,0.15); }
.alt-nav .ikon { font-size: 19px; }

.abonelik-uyari-banner {
    background: rgba(201,138,43,0.15);
    color: var(--orange);
    border-bottom: 1px solid var(--orange);
    text-align: center;
    font-size: 12.5px;
    padding: 8px 12px;
}
.abonelik-uyari-banner a { color: var(--orange); font-weight: 700; text-decoration: underline; margin-left: 6px; }

/* --- form elemanları --- */
label { display: block; font-size: 13px; color: var(--text-dim); margin: 12px 0 4px; }
input[type=text], input[type=password], input[type=number], input[type=tel], input[type=email], select, textarea {
    width: 100%;
    background: var(--card2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 11px 12px;
    font-size: 15px;
    font-family: inherit;
}
input:disabled { opacity: 0.6; }
textarea { resize: vertical; }

/* Tarayıcı "otomatik doldur" (autofill) özelliği kendi arka plan rengini
   zorla uygular (genelde beyaz/sarı) ve normal CSS bunu ezemez.
   Bu üçü olmadan, özellikle telefon alanları otomatik dolunca
   temadan bağımsız çirkin/bozuk görünür. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-text-fill-color: var(--text) !important;
    -webkit-box-shadow: 0 0 0 1000px var(--card2) inset !important;
    box-shadow: 0 0 0 1000px var(--card2) inset !important;
    caret-color: var(--text);
    transition: background-color 9999s ease-in-out 0s;
}

.btn {
    display: inline-block;
    text-align: center;
    border: none;
    border-radius: 9px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: white;
}
.btn-tam { width: 100%; }
.btn-buyuk { padding: 13px; font-size: 15px; margin-top: 16px; }
.btn-kucuk { padding: 7px 12px; font-size: 12.5px; }
.btn-birincil { background: var(--accent); }
.btn-birincil:hover { background: var(--accent-hover); }
.btn-ikincil { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-tehlike { background: #a83232; }
.btn-tehlike:hover { background: #822525; }

/* --- flash mesajları --- */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.flash-hata { background: rgba(224,85,85,0.15); color: var(--red); border: 1px solid var(--red); }
.flash-basari { background: rgba(43,201,113,0.15); color: var(--green); border: 1px solid var(--green); }

/* --- giriş sayfası --- */
.giris-sayfasi { display: flex; align-items: center; justify-content: center; min-height: 90vh; }
.giris-kutu { width: 100%; max-width: 360px; text-align: center; }
.giris-logo { font-size: 42px; margin-bottom: 6px; }
.giris-kutu h1 { font-size: 20px; margin: 6px 0; }
.giris-alt-yazi { color: var(--text-dim); font-size: 13px; margin-bottom: 10px; }
.giris-kutu form { text-align: left; }
.giris-alt-link { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-dim); }
.giris-alt-link a { color: var(--accent); font-weight: 600; }

/* --- liste (müşteriler / arşiv) --- */
.mini-ozet { color: var(--green); font-size: 13px; text-align: center; margin-bottom: 10px; }
.arama-form { margin-bottom: 14px; }
.bos-durum { text-align: center; color: var(--text-dim); padding: 40px 10px; }

.liste { display: flex; flex-direction: column; gap: 10px; }
.liste-satir {
    background: var(--card);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.liste-satir-ad { font-size: 16px; font-weight: 700; }
.liste-satir-sag { text-align: right; }
.liste-satir-adet { font-size: 12.5px; color: var(--text-dim); }
.liste-satir-bakiye { font-size: 12px; margin-top: 3px; font-weight: 600; }
.liste-satir-bakiye.borc { color: var(--red); }
.liste-satir-bakiye.alacak { color: var(--blue2); }

/* --- bakiye kartı --- */
.bakiye-kart { background: var(--card); border-radius: 12px; padding: 16px; margin: 14px 0; }
.bakiye-tutar { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.bakiye-tutar.borc { color: var(--red); }
.bakiye-tutar.alacak { color: var(--blue2); }
.bakiye-tutar.temiz { color: var(--green); }
.bakiye-butonlar { display: flex; gap: 10px; flex-wrap: wrap; }
.bakiye-butonlar details { flex: 1; min-width: 140px; }
.bakiye-butonlar summary { list-style: none; cursor: pointer; }
.bakiye-butonlar summary::-webkit-details-marker { display: none; }
.mini-form { margin-top: 10px; }
.ipucu { font-size: 11.5px; color: var(--text-dim); margin: 6px 0; }

.odeme-gecmisi { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; }
.odeme-gecmisi-baslik { font-size: 12.5px; font-weight: 700; color: var(--text-dim); margin-bottom: 6px; }
.odeme-satiri { font-size: 12px; color: var(--text-dim); margin-bottom: 3px; }

/* --- ürün kartları --- */
.urun-listesi { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.urun-karti { background: var(--card); border-radius: 12px; overflow: hidden; }
.urun-govde { display: flex; padding: 14px; gap: 12px; }
.urun-resim-onizleme img {
    width: 64px; height: 64px; object-fit: cover; border-radius: 8px; display: block;
}
.urun-bilgi { flex: 1; min-width: 0; }
.urun-ust-satir { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.urun-baslik { font-size: 15px; font-weight: 700; }
.urun-aciklama { margin: 6px 0 4px; font-size: 14px; }
.urun-alt-bilgi { font-size: 11.5px; color: var(--text-dim); }
.urun-not { font-size: 12.5px; font-style: italic; color: #cccccc; margin-top: 6px; }

.durum-etiket { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 20px; white-space: nowrap; }
.durum-ATÖLYEDE { color: var(--orange); background: rgba(201,138,43,0.15); }
.durum-HAZIR { color: var(--blue2); background: rgba(43,143,201,0.15); }
.durum-TESLIM-EDILDI, .durum-TESLİM-EDİLDİ { color: var(--green); background: rgba(43,201,113,0.15); }

.urun-eylemler {
    display: flex; flex-wrap: wrap; gap: 8px;
    padding: 0 14px 14px;
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 2px;
}
.satir-form { display: inline; }

/* --- yeni ürün formu --- */
.urun-satiri-form {
    background: var(--card);
    border-radius: 12px;
    padding: 14px;
    margin: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.satir-ust { display: flex; gap: 8px; }
.satir-ust select, .satir-ust input { flex: 1; }
.satir-alt { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.resim-sec-etiket {
    display: inline-block;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 7px 12px;
    font-size: 12.5px;
    cursor: pointer;
}
.resim-dosya-adi { font-size: 11.5px; color: var(--text-dim); word-break: break-all; }

/* --- raporlar --- */
.ozet-kartlar { display: flex; gap: 10px; margin-bottom: 14px; }
.ozet-kart { flex: 1; background: var(--card); border-radius: 12px; padding: 14px 8px; text-align: center; }
.ozet-baslik { font-size: 12px; color: var(--text-dim); }
.ozet-tutar { font-size: 18px; font-weight: 700; margin-top: 4px; }

.karsilastirma-kart { background: var(--card); border-radius: 12px; padding: 16px; margin-bottom: 16px; text-align: center; }
.karsilastirma-baslik { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.karsilastirma-satir { display: flex; flex-direction: column; gap: 6px; }
.karsilastirma-eski { color: var(--text-dim); font-size: 13px; }
.karsilastirma-yeni { font-weight: 700; font-size: 15px; }
.karsilastirma-yeni.yesil { color: var(--green); }
.karsilastirma-yeni.kirmizi { color: var(--red); }

.bolum-baslik { font-size: 15px; font-weight: 700; margin: 10px 0; }
.donut-bolumu { margin-bottom: 20px; }
.donut-icerik { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-grafik {
    width: 150px; height: 150px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.donut-ortasi {
    width: 90px; height: 90px; border-radius: 50%;
    background: var(--bg);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-weight: 700; font-size: 15px;
}
.donut-ortasi small { font-size: 10px; color: var(--text-dim); font-weight: 400; }
.donut-legend { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 6px; }
.legend-satiri { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.legend-kutu { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
.legend-etiket { flex: 1; }
.legend-deger { color: var(--text-dim); font-size: 11.5px; }

.islem-listesi { display: flex; flex-direction: column; gap: 8px; }
.islem-satiri {
    background: var(--card); border-radius: 10px; padding: 10px 14px;
    display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.islem-renk-noktasi { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.islem-metni { flex: 1; }
.islem-tutari { color: var(--green); font-size: 12px; }

/* --- kullanıcılar --- */
.kullanici-listesi { display: flex; flex-direction: column; gap: 8px; }
.kullanici-satiri {
    background: var(--card); border-radius: 10px; padding: 12px 14px;
    display: flex; justify-content: space-between; align-items: center; font-size: 14px;
}

/* --- Hukuki sayfalar (gizlilik, sartlar, iade, iletisim) --- */
.hukuki-icerik h2 { font-size: 17px; margin: 28px 0 10px; color: var(--text); }
.hukuki-icerik h2:first-child { margin-top: 0; }
.hukuki-icerik p, .hukuki-icerik li { font-size: 14px; line-height: 1.7; color: var(--text-dim); }
.hukuki-icerik ul { padding-left: 20px; margin: 8px 0; }
.hukuki-icerik strong { color: var(--text); }
.hukuki-icerik .guncel-tarih { font-size: 12px; color: var(--text-dim); margin-bottom: 20px; }
.hukuki-icerik .doldur { color: var(--orange); font-weight: 600; }
