/* ==========================================================================
   LexPro 2 — Mobil Arayüz
   Tasarım belirteçleri masaüstü (desktop/theme.py) ile BİREBİR aynıdır;
   ikisi de PHP sisteminin style.css dosyasından çıkarılmıştır.
   ========================================================================== */

:root {
  /* Arka plan */
  --bg-primary:    #0b1628;
  --bg-secondary:  #111f35;
  --bg-tertiary:   #162236;
  --bg-card:       #1a2b42;
  --bg-input:      #0d1b2f;
  --bg-table-head: #0e2040;
  --bg-table-row:  #ffffff;

  /* Kenarlık */
  --border:        #1e3456;
  --border-light:  #2a4570;

  /* Metin */
  --text-primary:  #e2e8f0;
  --text-secondary:#8a99b8;
  --text-muted:    #4a5a72;
  --text-dark:     #0f172a;

  /* Vurgu */
  --accent:        #4f7cf4;
  --accent-hover:  #3b68e0;
  --accent-light:  rgba(79,124,244,.15);
  --gold:          #d4af37;
  --gold-light:    rgba(212,175,55,.15);

  /* Semantik */
  --success:       #10b981;
  --danger:        #ef4444;
  --warning:       #f59e0b;
  --info:          #06b6d4;

  --sidebar-bg:    #06101e;
  --radius:        10px;
  --radius-sm:     6px;
  --radius-lg:     16px;
  --shadow:        0 4px 16px rgba(0,0,0,.35);
  --shadow-lg:     0 12px 40px rgba(0,0,0,.5);

  --alt-bar:       62px;
  --ust-bar:       56px;
}

[data-tema="light"] {
  --bg-primary:    #f1f5f9;
  --bg-secondary:  #e8eef8;
  --bg-tertiary:   #dde7f5;
  --bg-card:       #ffffff;
  --bg-input:      #f8fafc;
  --bg-table-head: #1e293b;
  --border:        #e2e8f0;
  --border-light:  #cbd5e1;
  --text-primary:  #0f172a;
  --text-secondary:#475569;
  --text-muted:    #94a3b8;
  --accent:        #2563eb;
  --accent-hover:  #1d4ed8;
  --accent-light:  rgba(37,99,235,.10);
  --gold:          #b45309;
  --gold-light:    rgba(180,83,9,.10);
  --sidebar-bg:    #1e293b;
  --shadow:        0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:     0 8px 30px rgba(0,0,0,.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { font-size: 15px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.55;
  min-height: 100vh;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
}

/* ── Yükleme perdesi ─────────────────────────────────────────────────── */
#perde {
  position: fixed; inset: 0; z-index: 999;
  background: var(--bg-primary);
  display: flex; align-items: center; justify-content: center;
}
.spinner {
  width: 34px; height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: don .7s linear infinite;
}
@keyframes don { to { transform: rotate(360deg); } }

/* ── Giriş ekranı ────────────────────────────────────────────────────── */
#giris {
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 24px;
}
.giris-kart {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  width: 100%; max-width: 400px;
  box-shadow: var(--shadow-lg);
}
.giris-logo { font-size: 46px; text-align: center; }
.giris-baslik {
  font-size: 26px; font-weight: 800; text-align: center; margin-top: 6px;
}
.giris-alt {
  color: var(--text-muted); text-align: center;
  font-size: .86rem; margin-bottom: 22px;
}

/* ── Form öğeleri ────────────────────────────────────────────────────── */
label.etiket {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--text-secondary); margin: 12px 0 5px;
}
input[type=text], input[type=password], input[type=search],
input[type=date], input[type=time], select, textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 1rem;          /* iOS'ta 16px altı otomatik yakınlaştırma yapar */
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}
textarea { resize: vertical; min-height: 80px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: .95rem; font-weight: 600; font-family: inherit;
  cursor: pointer; width: 100%;
  transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .55; }
.btn.success { background: var(--success); }
.btn.danger  { background: var(--danger); }
.btn.warning { background: var(--warning); color: #0f172a; }
.btn.outline {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
.btn.ghost { background: transparent; color: var(--accent); }
.btn.sm { padding: 8px 12px; font-size: .85rem; width: auto; }
.btn-satir { display: flex; gap: 8px; }

/* Onay kutusu — “Dosya içeriğinde de ara” */
.kutu-satir {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
}
.kutu-satir input { width: 20px; height: 20px; accent-color: var(--accent); }
.kutu-satir .metin { font-size: .88rem; color: var(--text-secondary); }
.kutu-satir.aktif {
  border-color: var(--accent);
  background: var(--accent-light);
}
.kutu-satir.aktif .metin { color: var(--accent); font-weight: 600; }

/* ── Uygulama kabuğu ─────────────────────────────────────────────────── */
#uygulama { display: none; padding-bottom: calc(var(--alt-bar) + 12px); }
#uygulama.acik { display: block; }

.ust-bar {
  position: sticky; top: 0; z-index: 50;
  height: var(--ust-bar);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  padding-top: env(safe-area-inset-top);
}
.ust-bar h1 { font-size: 1.05rem; font-weight: 700; flex: 1; }
.ust-bar .ikon-btn {
  background: transparent; border: none; color: var(--text-secondary);
  font-size: 1.2rem; padding: 8px; cursor: pointer; border-radius: 8px;
}
.ust-bar .ikon-btn:active { background: var(--accent-light); }

.sayfa { padding: 14px; }
.sayfa.gizli { display: none; }

/* ── Kart ────────────────────────────────────────────────────────────── */
.kart {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.kart-baslik {
  font-size: .95rem; font-weight: 700; color: var(--gold);
  margin-bottom: 10px; display: flex; align-items: center; gap: 7px;
}

/* İstatistik ızgarası */
.ist-izgara { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.ist-kart {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 13px;
}
.ist-etiket {
  font-size: .68rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.ist-deger { font-size: 1.75rem; font-weight: 800; line-height: 1.15; margin-top: 2px; }
.ist-alt { font-size: .74rem; color: var(--text-muted); }

/* ── Liste öğesi ─────────────────────────────────────────────────────── */
.oge {
  background: var(--bg-secondary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .15s;
}
.oge:active { border-color: var(--accent); }
/* Okunmuş bildirim — soluk ama hâlâ okunabilir (WCAG AA üstü kontrast) */
.oge.okundu { opacity: .62; }
.oge-ust { display: flex; align-items: flex-start; gap: 8px; }
.oge-baslik { font-weight: 600; font-size: .93rem; flex: 1; }
.oge-alt { font-size: .8rem; color: var(--text-muted); margin-top: 3px; }
.oge-baglam {
  font-size: .8rem; color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-radius: 4px; padding: 7px 9px; margin-top: 7px;
  border-left: 3px solid var(--warning);
}

/* ── Rozet ───────────────────────────────────────────────────────────── */
.rozet {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 20px;
  font-size: .7rem; font-weight: 700; white-space: nowrap;
}
.rozet.gecti, .rozet.bugun   { background: rgba(239,68,68,.15);  color: var(--danger); }
.rozet.kritik, .rozet.yakin  { background: rgba(245,158,11,.15); color: var(--warning); }
.rozet.yaklasiyor            { background: rgba(6,182,212,.15);  color: var(--info); }
.rozet.normal                { background: rgba(16,185,129,.15); color: var(--success); }
.rozet.muted                 { background: rgba(100,116,139,.15);color: var(--text-secondary); }
.rozet.accent                { background: var(--accent-light);  color: var(--accent); }
.rozet.gold                  { background: var(--gold-light);    color: var(--gold); }

/* ── Uyarı bandı ─────────────────────────────────────────────────────── */
.uyari {
  border-radius: var(--radius-sm); padding: 11px 13px; margin-bottom: 9px;
  display: flex; gap: 9px; align-items: flex-start; font-size: .85rem;
}
.uyari .b { font-weight: 700; }
.uyari.danger  { background: rgba(239,68,68,.12);  border: 1px solid rgba(239,68,68,.35);  color: var(--danger); }
.uyari.warning { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.35); color: var(--warning); }
.uyari.info    { background: rgba(6,182,212,.12);  border: 1px solid rgba(6,182,212,.35);  color: var(--info); }
.uyari.success { background: rgba(16,185,129,.12); border: 1px solid rgba(16,185,129,.35); color: var(--success); }
.uyari .govde { color: var(--text-secondary); font-weight: 400; }

/* ── Boş durum ───────────────────────────────────────────────────────── */
.bos { text-align: center; padding: 44px 18px; color: var(--text-muted); }
.bos .ikon { font-size: 42px; opacity: .55; }
.bos h3 { font-size: 1.02rem; color: var(--text-secondary); margin: 10px 0 5px; }
.bos p { font-size: .86rem; }

/* ── Alt gezinme ─────────────────────────────────────────────────────── */
.alt-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  height: calc(var(--alt-bar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--sidebar-bg);
  border-top: 1px solid var(--border);
  display: flex;
}
.alt-bar button {
  flex: 1; background: transparent; border: none;
  color: var(--text-muted); font-family: inherit;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; cursor: pointer; padding: 6px 2px;
  position: relative;
}
.alt-bar button .ik { font-size: 1.22rem; }
.alt-bar button .yz { font-size: .66rem; font-weight: 600; }
.alt-bar button.aktif { color: var(--accent); }
.alt-bar button.aktif::before {
  content: ''; position: absolute; top: 0; left: 22%; right: 22%;
  height: 2px; background: var(--accent); border-radius: 0 0 2px 2px;
}
.alt-bar .sayac {
  position: absolute; top: 4px; right: 50%; transform: translateX(20px);
  background: var(--danger); color: #fff;
  font-size: .6rem; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ── Detay ───────────────────────────────────────────────────────────── */
.detay-ust {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.detay-baslik { font-size: 1.12rem; font-weight: 700; }
.detay-alt { font-size: .84rem; color: var(--text-muted); margin-top: 3px; }
.alan-izgara {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px;
}
.alan .e {
  font-size: .66rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
}
.alan .d { font-size: .9rem; font-weight: 600; margin-top: 1px; }

.sekmeler {
  display: flex; gap: 4px; overflow-x: auto; margin-bottom: 12px;
  padding-bottom: 3px; -webkit-overflow-scrolling: touch;
}
.sekmeler button {
  background: transparent; border: none; border-bottom: 2px solid transparent;
  color: var(--text-secondary); font-family: inherit;
  font-size: .87rem; font-weight: 600; padding: 8px 12px;
  white-space: nowrap; cursor: pointer;
}
.sekmeler button.aktif { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Süre gerekçe kutusu ─────────────────────────────────────────────── */
.gerekce {
  background: var(--bg-tertiary); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px; margin-top: 9px;
  font-size: .8rem; color: var(--text-secondary);
}
.gerekce .tarih {
  font-size: 1.12rem; font-weight: 800; color: var(--gold); margin-bottom: 5px;
}
.gerekce ul { margin: 5px 0 0 16px; }
.gerekce li { margin-bottom: 3px; }
.gerekce .uyari-metin { color: var(--warning); margin-top: 7px; display: block; }

/* ── Takvim ──────────────────────────────────────────────────────────── */
.takvim-ust {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.takvim-ust .ay { flex: 1; text-align: center; font-weight: 700; font-size: 1.02rem; }
.takvim-izgara { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.takvim-izgara .gun-adi {
  text-align: center; font-size: .62rem; font-weight: 700;
  color: var(--text-muted); padding: 3px 0;
}
.takvim-hucre {
  aspect-ratio: 1; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 6px;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; cursor: pointer; position: relative;
  font-size: .82rem;
}
.takvim-hucre.disay { opacity: .32; }
.takvim-hucre.tatil { color: var(--danger); background: var(--bg-tertiary); }
.takvim-hucre.bugun { border: 2px solid var(--accent); font-weight: 800; color: var(--accent); }
.takvim-hucre.secili { background: var(--accent-light); border-color: var(--accent); }
.takvim-hucre .nokta {
  position: absolute; bottom: 5px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--accent);
}

/* ── Bildirim ────────────────────────────────────────────────────────── */
#bildirimler {
  position: fixed; left: 12px; right: 12px;
  bottom: calc(var(--alt-bar) + 14px + env(safe-area-inset-bottom));
  z-index: 200; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.bildirim {
  background: var(--bg-card); border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: .88rem; box-shadow: var(--shadow-lg);
  animation: gir .25s ease;
}
.bildirim.success { border-left-color: var(--success); }
.bildirim.error   { border-left-color: var(--danger); }
.bildirim.warning { border-left-color: var(--warning); }
.bildirim.info    { border-left-color: var(--info); }
@keyframes gir { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Modal ───────────────────────────────────────────────────────────── */
.modal-perde {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.62); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--bg-card); width: 100%; max-width: 520px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto;
  animation: yukari .22s ease;
}
@keyframes yukari { from { transform: translateY(100%); } to { transform: none; } }
.modal h3 { font-size: 1.05rem; margin-bottom: 12px; }

/* ── Yardımcılar ─────────────────────────────────────────────────────── */
.arasatir { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.soluk { color: var(--text-muted); font-size: .82rem; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mb8 { margin-bottom: 8px; }
.ortala { text-align: center; }
.gizli { display: none !important; }
.cevrimdisi-bant {
  background: var(--warning); color: #0f172a;
  text-align: center; font-size: .78rem; font-weight: 600; padding: 5px;
}
