/* ============================================
   HACI BESİM APARTMANI - ANA CSS
   ============================================ */
:root {
--primary: #0A2540;
--primary-light: #1a3a5c;
--accent: #00C48C;
--accent2: #0066FF;
--danger: #E24B4A;
--warn: #EF9F27;
--bg: #F0F4F8;
--card: #ffffff;
--border: #E2E8F0;
--text: #0A2540;
--muted: #64748B;
--success: #00C48C;
--radius: 14px;
--radius-sm: 10px;
--shadow: 0 2px 12px rgba(10,37,64,.08);
--shadow-md: 0 4px 24px rgba(10,37,64,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
font-family: 'Inter', system-ui, -apple-system, sans-serif;
background: var(--bg);
color: var(--text);
min-height: 100vh;
font-size: 14px;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
}

/* FLASH MESAJ */
.flash-msg {
position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
padding: 12px 24px; border-radius: 30px; font-size: 13px; font-weight: 600;
z-index: 9999; white-space: nowrap; box-shadow: var(--shadow-md);
transition: opacity .4s; animation: slideDown .3s ease;
}
.flash-success { background: var(--accent); color: #fff; }
.flash-error   { background: var(--danger); color: #fff; }
.flash-warn{ background: var(--warn); color: #fff; }
@keyframes slideDown { from { opacity:0; transform:translateX(-50%) translateY(-10px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }

/* ======== LOGIN ======== */
.login-page {
min-height: 100vh;
background: linear-gradient(135deg, #0A2540 0%, #1a4a7a 60%, #0d3260 100%);
display: flex; align-items: center; justify-content: center;
padding: 20px;
}
.login-box {
background: rgba(255,255,255,0.08);
border: 1px solid rgba(255,255,255,0.15);
border-radius: 24px;
padding: 44px 40px;
width: 100%; max-width: 400px;
backdrop-filter: blur(20px);
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .icon { font-size: 48px; display: block; margin-bottom: 12px; }
.login-logo h1 { color: #fff; font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.login-logo p { color: rgba(255,255,255,0.5); font-size: 11px; margin-top: 4px; letter-spacing: 2px; text-transform: uppercase; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; color: rgba(255,255,255,0.65); font-size: 12px; font-weight: 600; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .6px; }
.form-group input, .form-group select {
width: 100%; padding: 12px 16px;
background: rgba(255,255,255,0.1);
border: 1px solid rgba(255,255,255,0.2);
border-radius: var(--radius-sm); color: #fff; font-size: 15px; outline: none;
transition: border-color .2s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--accent); }
.form-group input::placeholder { color: rgba(255,255,255,0.35); }
.form-group select option { background: #0A2540; }

.btn-login {
width: 100%; padding: 14px;
background: linear-gradient(135deg, var(--accent), #00a572);
border: none; border-radius: var(--radius-sm); color: #fff;
font-size: 15px; font-weight: 700; cursor: pointer;
margin-top: 8px; transition: transform .1s, opacity .2s;
}
.btn-login:hover { opacity: .9; }
.btn-login:active { transform: scale(.98); }
.login-hint { color: rgba(255,255,255,0.35); font-size: 11px; text-align: center; margin-top: 16px; }
.login-error { background: rgba(226,75,74,0.2); border: 1px solid rgba(226,75,74,0.4); border-radius: 8px; color: #ff9999; font-size: 13px; padding: 10px 14px; margin-bottom: 16px; text-align: center; }

/* ======== LAYOUT ======== */
.topbar {
background: var(--primary);
color: #fff;
padding: 0 20px;
height: 60px;
display: flex; align-items: center; justify-content: space-between;
position: sticky; top: 0; z-index: 200;
box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-brand .icon { font-size: 24px; }
.topbar-brand .title { font-size: 15px; font-weight: 700; line-height: 1.2; }
.topbar-brand .sub { font-size: 10px; color: rgba(255,255,255,0.5); letter-spacing: 1px; text-transform: uppercase; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.user-avatar {
width: 36px; height: 36px; border-radius: 50%;
background: var(--accent); display: flex; align-items: center; justify-content: center;
font-weight: 700; font-size: 13px; cursor: pointer; position: relative;
}
.btn-topbar {
background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
color: #fff; padding: 6px 14px; border-radius: 8px; cursor: pointer;
font-size: 12px; font-weight: 500; text-decoration: none;
display: inline-flex; align-items: center; gap: 5px;
transition: background .2s;
}
.btn-topbar:hover { background: rgba(255,255,255,0.18); }

/* ALT NAVİGASYON */
.bottom-nav {
position: fixed; bottom: 0; left: 0; right: 0;
background: var(--card); border-top: 1px solid var(--border);
display: flex; z-index: 200;
box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
flex: 1; padding: 10px 6px 8px;
border: none; background: transparent; color: var(--muted);
cursor: pointer; font-size: 10px; font-weight: 600;
display: flex; flex-direction: column; align-items: center; gap: 4px;
transition: color .2s; text-decoration: none;
}
.nav-item.active { color: var(--accent2); }
.nav-item .nav-icon { font-size: 20px; }
.nav-item span { font-size: 10px; }

/* SAYFA İÇERİĞİ */
.page-content { padding: 16px; padding-bottom: 80px; max-width: 680px; margin: 0 auto; }

/* ======== KARTLAR ======== */
.card {
background: var(--card);
border-radius: var(--radius);
border: 1px solid var(--border);
padding: 18px;
margin-bottom: 14px;
box-shadow: var(--shadow);
}
.card-title {
font-size: 11px; font-weight: 700; color: var(--muted);
text-transform: uppercase; letter-spacing: .8px;
margin-bottom: 16px;
display: flex; align-items: center; justify-content: space-between;
}

/* HERO KART */
.hero-card {
background: linear-gradient(135deg, #0A2540 0%, #1a4a7a 100%);
border-radius: 20px; padding: 24px 22px; margin-bottom: 16px;
color: #fff; position: relative; overflow: hidden;
box-shadow: var(--shadow-md);
}
.hero-card::before {
content: ''; position: absolute; right: -30px; top: -30px;
width: 150px; height: 150px; background: rgba(255,255,255,0.04); border-radius: 50%;
}
.hero-card::after {
content: ''; position: absolute; right: 30px; bottom: -40px;
width: 100px; height: 100px; background: rgba(255,255,255,0.03); border-radius: 50%;
}
.hero-label { font-size: 12px; color: rgba(255,255,255,0.6); margin-bottom: 6px; }
.hero-amount { font-size: 34px; font-weight: 800; letter-spacing: -1.5px; margin-bottom: 4px; }
.hero-sub { font-size: 12px; color: rgba(255,255,255,0.5); }
.hero-badge {
display: inline-block; margin-top: 10px;
background: rgba(0,196,140,0.2); color: #00C48C;
border: 1px solid rgba(0,196,140,0.3);
border-radius: 20px; padding: 4px 12px; font-size: 11px; font-weight: 600;
}
.hero-badge.warn { background: rgba(239,159,39,0.2); color: #EF9F27; border-color: rgba(239,159,39,0.3); }

/* İSTATİSTİK KARTLAR */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat-card {
background: var(--card); border: 1px solid var(--border);
border-radius: var(--radius-sm); padding: 14px 16px;
box-shadow: var(--shadow);
}
.stat-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.1; }
.stat-sub { font-size: 10px; color: var(--muted); margin-top: 3px; }
.stat-card.danger .stat-value { color: var(--danger); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.warn .stat-value { color: var(--warn); }

/* İŞLEM SATIRLARI */
.tx-list { display: flex; flex-direction: column; }
.tx-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.tx-item:last-child { border-bottom: none; }
.tx-icon {
width: 40px; height: 40px; border-radius: 12px;
display: flex; align-items: center; justify-content: center;
font-size: 18px; flex-shrink: 0;
}
.tx-icon.income  { background: #E1F5EE; }
.tx-icon.expense { background: #FAECE7; }
.tx-icon.pending { background: #FAEEDA; }
.tx-icon.info{ background: #E6F1FB; }
.tx-info { flex: 1; min-width: 0; }
.tx-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-date { font-size: 11px; color: var(--muted); margin-top: 2px; }
.tx-amount { font-size: 14px; font-weight: 700; flex-shrink: 0; }
.tx-amount.pos { color: var(--success); }
.tx-amount.neg { color: var(--danger); }
.tx-amount.pend { color: var(--warn); }

/* ROZET */
.badge {
display: inline-block; padding: 3px 10px;
border-radius: 20px; font-size: 11px; font-weight: 600;
}
.badge-success { background: #E1F5EE; color: #0F6E56; }
.badge-danger  { background: #FAECE7; color: #993C1D; }
.badge-warn{ background: #FAEEDA; color: #854F0B; }
.badge-info{ background: #E6F1FB; color: #185FA5; }
.badge-gray{ background: #F1EFE8; color: #5F5E5A; }

.cat-badge { background: #FAEEDA; color: #854F0B; padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 600; }

/* TABLO */
.tablo { width: 100%; border-collapse: collapse; font-size: 12px; }
.tablo th { text-align: left; padding: 10px 8px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; border-bottom: 2px solid var(--border); }
.tablo td { padding: 12px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tablo tr:last-child td { border-bottom: none; }
.tablo tr:hover td { background: #f8fafc; }

/* FORMLAR */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
.form-row input, .form-row select, .form-row textarea {
width: 100%; padding: 11px 14px;
border: 1.5px solid var(--border); border-radius: var(--radius-sm);
font-size: 14px; color: var(--text); background: var(--card); outline: none;
transition: border-color .2s, box-shadow .2s;
font-family: inherit;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
border-color: var(--accent2);
box-shadow: 0 0 0 3px rgba(0,102,255,0.1);
}
.form-row textarea { resize: vertical; min-height: 70px; }
.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* BUTONLAR */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; cursor: pointer; border: none; transition: transform .1s, opacity .2s; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(135deg, #0066FF, #0044cc); color: #fff; width: 100%; padding: 13px; }
.btn-primary:hover { opacity: .9; }
.btn-success { background: linear-gradient(135deg, var(--accent), #00a572); color: #fff; }
.btn-danger  { background: linear-gradient(135deg, #E24B4A, #c03939); color: #fff; }
.btn-warn{ background: linear-gradient(135deg, #EF9F27, #cc8010); color: #fff; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent2); color: var(--accent2); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-icon { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; transition: all .15s; }
.btn-icon:hover.del { background: #fee; border-color: #fcc; }
.btn-icon:hover.edit { background: #e6f1fb; border-color: #b5d4f4; }
.btn-actions { display: flex; gap: 5px; }

/* UYARI KUTULARI */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; display: flex; align-items: flex-start; gap: 10px; }
.alert-success { background: #E1F5EE; color: #0F6E56; border: 1px solid #9FE1CB; }
.alert-danger  { background: #FCEBEB; color: #A32D2D; border: 1px solid #F7C1C1; }
.alert-warn{ background: #FAEEDA; color: #854F0B; border: 1px solid #FAC775; }
.alert-info{ background: #E6F1FB; color: #0C447C; border: 1px solid #B5D4F4; }

/* AVATAR */
.daire-avatar {
width: 36px; height: 36px; border-radius: 50%;
background: linear-gradient(135deg, var(--accent2), var(--accent));
display: flex; align-items: center; justify-content: center;
color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0;
}

/* PROGRESS */
.progress-bar { background: var(--border); border-radius: 20px; height: 5px; overflow: hidden; margin-top: 5px; }
.progress-fill { background: linear-gradient(90deg, var(--accent2), var(--accent)); border-radius: 20px; height: 5px; transition: width .3s; }

/* BÖLÜM SEKMELER */
.sec-tabs { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.sec-tab { padding: 7px 16px; border-radius: 20px; border: 1.5px solid var(--border); background: transparent; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: all .15s; }
.sec-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* MODAL */
.modal-overlay {
display: none; position: fixed; inset: 0;
background: rgba(0,0,0,0.5); z-index: 500;
align-items: flex-end; justify-content: center;
backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal-box {
background: var(--card); border-radius: 24px 24px 0 0;
padding: 28px 20px 32px; width: 100%; max-width: 500px;
max-height: 90vh; overflow-y: auto;
animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-title { font-size: 17px; font-weight: 800; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }
.modal-btns { display: flex; gap: 8px; margin-top: 18px; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); margin-left: auto; }

/* DEV TABS (kasaya) */
.dev-tabs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0; background: var(--bg); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); margin-bottom: 16px; }
.dev-tab { padding: 12px 8px; border: none; background: transparent; cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); transition: all .2s; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.dev-tab.active { background: var(--primary); color: #fff; }
.dev-tab .di { font-size: 20px; }

/* DEKONT */
.dekont-wrap {
background: #fff; border-radius: 16px; padding: 24px 20px;
border: 1px solid var(--border);
font-family: 'Courier New', monospace; font-size: 12px;
}
.dk-header { text-align: center; padding-bottom: 16px; border-bottom: 2px dashed var(--border); margin-bottom: 16px; }
.dk-header h2 { font-size: 17px; font-weight: 800; color: var(--primary); }
.dk-header p { font-size: 11px; color: var(--muted); margin-top: 3px; }
.dk-row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed #f0f0f0; }
.dk-row:last-child { border-bottom: none; }
.dk-row .dk { color: var(--muted); font-size: 11px; }
.dk-row .dv { font-weight: 600; font-size: 12px; }
.dk-total { margin-top: 14px; padding-top: 14px; border-top: 2px solid var(--primary); display: flex; justify-content: space-between; align-items: center; }
.dk-total .dtl { font-size: 13px; font-weight: 800; color: var(--primary); }
.dk-total .dtv { font-size: 20px; font-weight: 800; color: var(--success); }
.dk-stamp { margin-top: 14px; text-align: center; padding: 10px; background: #E1F5EE; border-radius: 8px; color: #0F6E56; font-weight: 800; font-size: 13px; }

/* DÖNEM KARTLARI */
.donem-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.donem-card { background: var(--card); border: 2px solid var(--border); border-radius: var(--radius); padding: 18px; transition: border-color .2s; }
.donem-card.aktif { border-color: var(--accent2); }
.donem-card.aktif2 { border-color: var(--warn); }
.donem-head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; display: flex; align-items: center; gap: 5px; }
.donem-head.d1 { color: var(--accent2); }
.donem-head.d2 { color: var(--warn); }

/* BOŞ DURUM */
.empty-state { text-align: center; padding: 32px 16px; color: var(--muted); font-size: 13px; }
.empty-state .ei { font-size: 36px; display: block; margin-bottom: 8px; }

/* YÜKLEME */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ======== MOBİL UYUM ======== */
@media (max-width: 480px) {
.login-box { padding: 32px 24px; border-radius: 20px; }
.stat-grid { gap: 8px; }
.stat-value { font-size: 18px; }
.form-cols { grid-template-columns: 1fr; }
.donem-grid { grid-template-columns: 1fr; }
.hero-amount { font-size: 28px; }
.tablo { font-size: 11px; }
.tablo td, .tablo th { padding: 9px 5px; }
}

/* ======== TABLET ======== */
@media (min-width: 768px) {
.page-content { padding: 24px; }
.stat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* GEÇİŞLER */
.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* BÖLÜM GİZLE/GÖSTER */
.tab-section { display: none; }
.tab-section.active { display: block; }

/* YÖNETİCİ - DİEZ GRID */
.kasaya-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .kasaya-grid { grid-template-columns: 1fr; } }

.kasaya-card { background: var(--card); border-radius: var(--radius); padding: 18px; border: 2px solid transparent; box-shadow: var(--shadow); }
.kasaya-card.tahsilat { border-color: #185FA5; }
.kasaya-card.nakit{ border-color: #0F6E56; }
.kasaya-card.gider{ border-color: #993C1D; }
.kasaya-head { font-size: 15px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 7px; }
.kasaya-head.t { color: #185FA5; }
.kasaya-head.n { color: #0F6E56; }
.kasaya-head.g { color: #993C1D; }

.kasaya-btn-t { background: #185FA5; border: none; color: #fff; padding: 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; cursor: pointer; width: 100%; margin-top: 4px; }
.kasaya-btn-n { background: #0F6E56; border: none; color: #fff; padding: 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; cursor: pointer; width: 100%; margin-top: 4px; }
.kasaya-btn-g { background: #993C1D; border: none; color: #fff; padding: 12px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; cursor: pointer; width: 100%; margin-top: 4px; }

/* Aktif kasaya kartı */
.kasaya-card.active-tab { box-shadow: 0 4px 20px rgba(0,0,0,0.15); transform: translateY(-2px); }
.kasaya-card.tahsilat.active-tab { background: #f0f5ff; }
.kasaya-card.nakit.active-tab{ background: #f0fff8; }
.kasaya-card.gider.active-tab{ background: #fff5f5; }

/* DOSYA INPUT */
.file-input-wrap { display: flex; align-items: center; gap: 8px; }
.file-input-wrap input[type="file"] { display: none; }
.file-label { padding: 8px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-size: 12px; cursor: pointer; color: var(--muted); }
.file-name { font-size: 12px; color: var(--muted); }

/* PWA install banner */
#pwa-banner { display: none; position: fixed; bottom: 70px; left: 16px; right: 16px; background: var(--primary); color: #fff; border-radius: 14px; padding: 14px 16px; z-index: 300; box-shadow: var(--shadow-md); align-items: center; gap: 12px; }
#pwa-banner.show { display: flex; }
#pwa-banner p { flex: 1; font-size: 13px; }
#pwa-banner button { padding: 8px 14px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; border: none; }
.pwa-install-btn { background: var(--accent); color: #fff; }
.pwa-dismiss-btn { background: rgba(255,255,255,.15); color: #fff; }

/* AYARLAR */
.ayar-section-title { font-size: 13px; font-weight: 700; color: var(--primary); margin: 18px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }

/* PRINT */
@media print {
.topbar, .bottom-nav, .btn-print-hide, #pwa-banner, .no-print { display: none !important; }
.dekont-wrap { box-shadow: none; border: 1px solid #ccc; }
body { background: #fff; }
.page-content { padding: 0; }
}

/* BENİ HATIRLA */
.remember-row { margin-bottom: 16px; margin-top: -4px; }
.remember-check {
    display: flex; align-items: center; gap: 10px;
    cursor: pointer; user-select: none;
}
.remember-check input[type="checkbox"] {
    display: none;
}
.check-box {
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .2s;
    flex-shrink: 0;
}
.remember-check input[type="checkbox"]:checked + .check-box {
    background: var(--accent);
    border-color: var(--accent);
}
.check-box::after {
    content: '';
    width: 10px; height: 7px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) scale(0);
    transition: transform .15s;
    margin-top: -2px;
}
.remember-check input[type="checkbox"]:checked + .check-box::after {
    transform: rotate(-45deg) scale(1);
}
.check-label {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 500;
}
