/* TELEFON GÖRÜNÜMÜ — Android uygulaması, ana ekrana eklenmiş site ve telefon tarayıcısında (html.app).
   Bilgisayar ve geniş tablette html.app eklenmez; bu kurallar devreye girmez. */
html.app { -webkit-tap-highlight-color: transparent; }
html.app, html.app body { overflow-x: clip; max-width: 100%; }
html.app body { overscroll-behavior-y: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.app input, html.app textarea, html.app select, html.app [contenteditable] { -webkit-user-select: text; user-select: text; font-size: 16px; }
html.app.app-cikis body { opacity: .55; transition: opacity .15s; }

/* Web'e ait parçalar uygulamada gizli */
html.app .tk-top, html.app .uyg-gizle, html.app-yerel #uygLink, html.app-pwa #uygLink { display: none !important; }
html.app body.tk-body { padding-top: env(safe-area-inset-top, 0px); }
html.app .content { padding: 14px 14px 24px; }

/* Üstte ince yükleniyor çizgisi */
#appYuk { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, #F59E0B, #E8590C); z-index: 9999;
  box-shadow: 0 0 10px rgba(232,89,12,.6); transition: width .5s ease, opacity .3s; opacity: 0; pointer-events: none; }
#appYuk.on { opacity: 1; width: 82%; transition: width 2.5s cubic-bezier(.1,.7,.2,1), opacity .1s; }

/* Aşağı çekip yenileme */
#appCek { position: fixed; top: -46px; left: 50%; width: 40px; height: 40px; margin-left: -20px; border-radius: 50%; background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.18); display: grid; place-items: center; z-index: 9998; pointer-events: none; opacity: 0; }
#appCek.goster { opacity: 1; }
#appCek svg { width: 22px; height: 22px; stroke: #E8590C; }
#appCek.hazir svg { stroke: #16A34A; }
#appCek.don svg { animation: appDon .8s linear infinite; }
@keyframes appDon { to { transform: rotate(360deg); } }

/* Alt sekme çubuğu */
html.app.app-sekmeli body { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
#appSekme { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; display: flex; background: rgba(255,255,255,.97);
  border-top: 1px solid #ECE6DD; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px rgba(20,17,15,.07);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
#appSekme a, #appSekme button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0 2px; border: 0;
  background: none; color: #8A817A; font: 700 11px/1.1 system-ui, -apple-system, 'Segoe UI', sans-serif; text-decoration: none; position: relative; }
#appSekme svg { width: 23px; height: 23px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#appSekme .on { color: #E8590C; }
#appSekme .on::before { content: ''; position: absolute; top: -7px; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: #E8590C; }
#appSekme a:active, #appSekme button:active { transform: scale(.92); }
#appSekme em { position: absolute; top: 0; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #DC2626;
  color: #fff; font: 800 10px/17px system-ui, sans-serif; font-style: normal; text-align: center; }

/* Yan menü uygulamada alttan açılan tam ekran menü gibi */
html.app .tk-side { transition: transform .22s ease; }
html.app .tk-backdrop { z-index: 950; }
html.app body.tk-nav-open .tk-side { z-index: 960; }

/* Kartlar ve düğmeler: dokunmaya uygun */
html.app .btn, html.app button { min-height: 40px; }
html.app .page-head h1 { font-size: 26px; letter-spacing: -.02em; }
html.app .card, html.app .kpi { border-radius: 16px; }

/* Giriş ekranı (uygulama) */
html.app body.giris { display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; padding: 0; min-height: 100vh; }
html.app body.giris .app-kahraman { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff;
  text-align: center; padding: calc(30px + env(safe-area-inset-top)) 24px 24px; }
html.app body.giris .app-kahraman .alev { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; font-size: 42px;
  background: linear-gradient(135deg, #F59E0B, #E8590C); box-shadow: 0 18px 40px -12px rgba(232,89,12,.9); margin-bottom: 18px; }
html.app body.giris .app-kahraman b { font-size: 28px; letter-spacing: -.02em; }
html.app body.giris .app-kahraman b span { color: #F59E0B; }
html.app body.giris .app-kahraman small { display: block; color: #D6D3D1; font-size: 15px; margin-top: 6px; font-weight: 500; }
html.app body.giris .kart { max-width: none; border-radius: 28px 28px 0 0; padding: 26px 22px calc(26px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 60px rgba(0,0,0,.35); animation: appSayfa .35s cubic-bezier(.2,.8,.2,1); }
html.app body.giris .kart .marka { display: none; }
@keyframes appSayfa { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
html:not(.app) .app-kahraman { display: none; }

/* ---- Telefon ekranına sığdırma (sayfa sağa sola kaymasın) ---- */
/* Bilgisayardaki yan yana sütunlar telefonda alt alta */
html.app .content :is(.grid-2, .grid-3, .grid-2-1, .grid-1-2, .split),
html.app .content [style*="grid-template-columns"][style*="minmax(2"],
html.app .content [style*="grid-template-columns"][style*="minmax(3"],
html.app .content [style*="grid-template-columns"][style*="minmax(4"] { grid-template-columns: minmax(0, 1fr) !important; }
html.app .content :is(.grid-2, .grid-3, .grid-2-1, .grid-1-2, .split, .kpis, [style*="grid"]) > * { min-width: 0; }
html.app .content .sticky { position: static !important; }
html.app .content :is(.card, .card-body, .stack, main) { min-width: 0; max-width: 100%; }
/* Tablolar ve sekmeler kendi içinde kayar, sayfa kaymaz */
html.app .content :is(.tbl-wrap, .card-body.flush) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
html.app .content .tabs { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
html.app .content .tabs::-webkit-scrollbar { display: none; }
/* Düğme grupları ve başlıklar satır kırar */
html.app .content :is(.row, .card-head, .page-head, .page-head .row) { flex-wrap: wrap; }
html.app .content .page-head { gap: 10px; }
html.app .content .btn { max-width: 100%; flex: 0 0 auto; }
html.app .content :is(h1, h2, h3, p) { overflow-wrap: anywhere; }

/* Ekrana sığmayan tablolar telefonda kart listesi (uygulama.js "kartli" sınıfını ekler) */
html.app table.kartli, html.app table.kartli tbody { display: block; width: 100%; }
html.app table.kartli thead { display: none; }
html.app table.kartli tr { display: block; background: #fff; border: 1px solid #ECE6DD; border-radius: 14px; margin: 0 0 10px; padding: 8px 12px;
  box-shadow: 0 1px 2px rgba(20,17,15,.04); }
html.app table.kartli tr:hover { background: #fff; }
html.app table.kartli td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0 !important;
  border: 0 !important; border-bottom: 1px dashed #F0EBE4 !important; text-align: right !important; white-space: normal; min-height: 0; }
html.app table.kartli td:last-child { border-bottom: 0 !important; }
html.app table.kartli td::before { content: attr(data-l); flex: 0 0 auto; max-width: 45%; color: #8A817A; font-size: 12px; font-weight: 700;
  text-align: left; text-transform: none; letter-spacing: 0; }
html.app table.kartli td[data-l=""]::before { display: none; }
html.app table.kartli td.ilk { justify-content: flex-start; text-align: left !important; font-size: 15px; font-weight: 700; border-bottom: 1px solid #F0EBE4 !important; padding-bottom: 8px !important; }
html.app table.kartli td.ilk::before { display: none; }
html.app table.kartli td:empty, html.app table.kartli td.bos { display: none; }
html.app table.kartli td[colspan] { justify-content: center; text-align: center !important; }
html.app table.kartli td[colspan]::before { display: none; }
html.app .card-body.flush:has(> table.kartli), html.app .tbl-wrap:has(> table.kartli) { padding: 10px; background: #F7F4EF; }
html.app table.kartli tfoot { display: block; }
html.app table.kartli tfoot tr { background: #FFF7ED; border-color: #FED7AA; }

/* Katlanan filtre formu */
html.app form.app-katli.app-katli { display: none !important; }
html.app .app-filtre-ac { display: flex; width: 100%; align-items: center; gap: 8px; margin: 0 0 12px; padding: 12px 14px; border-radius: 12px;
  background: #fff; border: 1px solid #ECE6DD; font-weight: 700; text-align: left; }
html.app .app-filtre-ac small { flex: 1; color: #8A817A; font-weight: 600; text-align: right; }
html.app .app-filtre-ac b { transition: transform .2s; }
html.app .app-filtre-ac.acik b { transform: rotate(180deg); }
.card-body > .app-filtre-ac, .card > .app-filtre-ac { margin: 0; border: 0; border-radius: 0; }

/* Tarih aralığı: hızlı seçimler kaydırılabilir çipler, iki tarih yan yana */
html.app form.filters:has(> .field input[name=from]) { display: grid !important; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; gap: 8px; align-items: end; padding: 12px; }
html.app form.filters:has(> .field input[name=from]) > .row { order: -1; grid-column: 1 / -1; flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; margin: 0 -12px 2px; padding: 0 12px; }
html.app form.filters:has(> .field input[name=from]) > .row::-webkit-scrollbar { display: none; }
html.app form.filters:has(> .field input[name=from]) > .row .btn { flex: 0 0 auto; border-radius: 999px; padding: 6px 14px; min-height: 34px; }
html.app form.filters:has(> .field input[name=from]) .field { margin: 0; min-width: 0; }
html.app form.filters:has(> .field input[name=from]) .field span { font-size: 11px; }
html.app form.filters:has(> .field input[name=from]) input[type=date] { width: 100%; min-width: 0; padding: 0 4px 0 8px; font-size: 13px; }
html.app form.filters:has(> .field input[name=from]) > .btn { height: 42px; }
html.app .content .form-actions { flex-wrap: wrap; gap: 8px; }
