/* ═══════════════════════════════════════════════════════════
   07-MOBILE — CEE İş Takip Mobil Tasarım
   Alt navigasyon, FAB butonu, responsive grid
   ═══════════════════════════════════════════════════════════ */

/* ═══ ALT NAVİGASYON (sadece mobil) ═══ */
.mob-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #1a1a1a;
  padding: 6px 0 env(safe-area-inset-bottom, 6px);
  z-index: 9990;
  box-shadow: 0 -2px 12px rgba(0,0,0,.2);
}
.mob-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 500px;
  margin: 0 auto;
}
.mn-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 6px 12px;
  background: none; border: none; color: #9ca3af;
  font-size: 10px; font-weight: 600; cursor: pointer;
  transition: color .15s; min-width: 56px;
}
.mn-item svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mn-item.active { color: #c2410c; }
.mn-item:active { color: #fff; }

/* FAB butonu */
.mn-fab {
  width: 52px; height: 52px;
  background: #c2410c;
  color: #fff;
  border: none; border-radius: 50%;
  font-size: 28px; font-weight: 300;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(194,65,12,.4);
  margin-top: -20px;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, box-shadow .2s;
}
.mn-fab:active { transform: scale(.9); }

/* FAB menü (açılır) */
.fab-menu {
  display: none;
  position: fixed;
  bottom: 80px; left: 50%; transform: translateX(-50%);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
  padding: 8px;
  z-index: 9991;
  min-width: 200px;
}
.fab-menu.open { display: block; }
.fab-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border: none; background: none; width: 100%;
  font-size: 14px; font-weight: 600; color: #1a1a1a;
  cursor: pointer; border-radius: 10px;
  transition: background .15s;
}
.fab-menu-item:hover, .fab-menu-item:active { background: #f3f4f6; }
.fab-menu-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 9989;
}
.fab-menu-overlay.open { display: block; }

/* ═══ TABLET (1024px) ═══ */
@media (max-width: 1024px) {
  .proj-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ═══ MOBİL (768px) ═══ */
@media (max-width: 768px) {
  /* Alt nav göster */
  .mob-nav { display: block; }

  /* Ana içerik alt nav yüksekliğini hesaba kat */
  .app-body { padding-bottom: 70px !important; }

  /* Footer gizle (alt nav var) */
  .app-foot { display: none !important; }

  /* Sidebar — overlay + slide */
  .app-side {
    position: fixed !important; top: 0; left: -280px; bottom: 0;
    width: 280px !important; max-width: 80vw;
    transition: left .25s ease;
    box-shadow: none; z-index: 9995 !important;
  }
  .app-side.open { left: 0; box-shadow: 4px 0 20px rgba(0,0,0,.4); }

  /* Breadcrumb overflow */
  .app-crumb { white-space: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .app-crumb .now { text-overflow: ellipsis; overflow: hidden; max-width: 200px; display: inline-block; vertical-align: bottom; }

  /* Dashboard */
  #dashboardRoot { padding: 14px !important; }
  .dash-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .dash-title { font-size: 22px; }
  .dash-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .dash-stat { padding: 14px; }
  .ds-val { font-size: 22px; }
  .ds-icon { width: 38px; height: 38px; font-size: 18px; }
  .dash-row { grid-template-columns: 1fr; }
  .dash-proj-grid { grid-template-columns: 1fr; }

  /* Proje kartları */
  .proj-grid { grid-template-columns: 1fr !important; gap: 10px; padding: 10px 0; }
  .proj-card { padding: 14px; }

  /* Detay paneli */
  .proj-detail { border-radius: 12px; }
  .pd-head { padding: 12px 16px; }
  .btabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; gap: 0; }
  .btab { white-space: nowrap; flex-shrink: 0; padding: 10px 12px; font-size: 12px; }

  /* Form alanları */
  .fg4 { grid-template-columns: 1fr 1fr !important; }
  .fg3 { grid-template-columns: 1fr !important; }
  .dis-grid { grid-template-columns: 1fr !important; }

  /* Dosya yöneticisi toolbar */
  .yx-toolbar { flex-wrap: wrap; gap: 4px; }
  .yx-tbtn { padding: 6px 8px; font-size: 14px; }

  /* Modal'lar */
  .bpane { padding: 12px !important; }

  /* Top bar */
  .app-top { padding: 0 10px; }
  .at-btn span.hide-sm { display: none; }
}

/* ═══ KÜÇÜK TELEFON (480px) ═══ */
@media (max-width: 480px) {
  :root { --top-h: 48px; }

  /* iOS zoom engeli */
  input, select, textarea { font-size: 16px !important; }

  /* 48px dokunma hedefi */
  .side-link { min-height: 48px; }
  .btab { min-height: 44px; }
  .ctab { min-height: 44px; padding: 8px 12px; font-size: 12px; }
  button { min-height: 36px; }

  /* Dashboard stat kartları */
  .dash-stat { padding: 10px; gap: 8px; }
  .ds-val { font-size: 18px; }
  .ds-icon { width: 32px; height: 32px; font-size: 16px; border-radius: 8px; }
  .ds-label { font-size: 10px; }

  /* Kart */
  .pc-name { font-size: 13px; }
  .pc-meta { font-size: 11px; }

  /* User menu — sadece avatar, isim gizle */
  .at-user .un { display: none; }
  .at-user .av { width: 32px; height: 32px; font-size: 12px; }
  .at-user { padding: 4px !important; min-width: auto !important; }

  /* Toolbar kompakt */
  .app-top { padding: 0 6px !important; }
  .at-actions { gap: 4px !important; }
  .at-btn { padding: 6px 8px !important; font-size: 11px !important; }
  .at-bell { font-size: 16px !important; padding: 4px !important; }
  .at-search { min-width: 0; flex: 1; }
  .at-search input { font-size: 13px !important; padding: 6px 8px !important; }
  .at-spacer { display: none !important; }

  /* User dropdown mobilde tam gorunsun */
  .user-menu { right: -10px !important; min-width: 200px; }

  /* Belediye checklist modal */
  .bpane { padding: 8px !important; }

  /* Müellif kartları */
  #muellifRoot > div { padding: 12px !important; }
}

/* ═══ ÇOK KÜÇÜK TELEFON (360px) ═══ */
@media (max-width: 360px) {
  .at-btn.primary span.hide-sm { display: none !important; }
  .at-btn.primary { padding: 6px 8px !important; font-size: 11px !important; }
  #sesliBtn { display: none !important; }
  .at-search input { font-size: 12px !important; }
  .at-bell { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
}

/* ═══ PRINT — mobil nav gizle ═══ */
@media print {
  .mob-nav, .fab-menu, .fab-menu-overlay { display: none !important; }
}
