/* Servisim — Mobil uygulama kabuğu */
:root {
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --bottom-nav-h: 68px;
  --app-header-h: 56px;
}

/* PWA / app hissi */
html {
  -webkit-text-size-adjust: 100%;
}
body.app-mode {
  overscroll-behavior-y: none;
  background: #eef2f5;
}

/* —— Mobil & tablet: panel kabuğu —— */
@media (max-width: 1024px) {
  body.app-mode.panel-mode {
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
  }

  .sidebar {
    width: min(86vw, 300px);
    padding-top: var(--safe-top);
    box-shadow: 8px 0 40px rgba(0,0,0,.35);
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8,16,22,.55);
    backdrop-filter: blur(4px);
    z-index: 35;
  }
  .sidebar-overlay.show { display: block; }

  .panel-main { margin-left: 0; }

  .topbar {
    height: calc(var(--app-header-h) + var(--safe-top));
    padding: var(--safe-top) 1rem 0;
    background: rgba(255,255,255,.92);
    backdrop-filter: saturate(1.4) blur(16px);
    -webkit-backdrop-filter: saturate(1.4) blur(16px);
    border-bottom: 1px solid rgba(226,232,237,.9);
  }
  .topbar .desktop-actions { display: none !important; }
  .hide-mobile { display: none !important; }
  .topbar-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.02em;
  }

  .panel-content {
    padding: 1rem 1rem calc(1.25rem + var(--safe-bottom));
  }

  .page-header {
    margin-bottom: 1rem;
  }
  .page-header h1 {
    font-size: 1.35rem;
    letter-spacing: -.02em;
  }
  .page-header .actions {
    width: 100%;
  }
  .page-header .actions .btn {
    flex: 1;
    min-height: 44px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem;
  }
  .stat {
    padding: 1rem;
    border-radius: 16px;
    border: none;
    box-shadow: 0 4px 16px rgba(15,28,36,.06);
  }
  .stat .value { font-size: 1.25rem; }

  .card {
    border: none;
    border-radius: 18px;
    padding: 1.1rem;
    box-shadow: 0 4px 20px rgba(15,28,36,.06);
  }

  .grid-2 { grid-template-columns: 1fr; gap: .85rem; }

  table.data { font-size: .82rem; }
  table.data th, table.data td { padding: .65rem .5rem; }

  .form-control, select.form-control, textarea.form-control {
    font-size: 16px; /* iOS zoom engeli */
    min-height: 48px;
    border-radius: 14px;
  }
  .btn {
    min-height: 48px;
    border-radius: 14px;
    font-size: .95rem;
  }
  .btn-sm { min-height: 40px; }

  .search-bar .form-control { max-width: none; flex: 1; }

  /* Alt sekme çubuğu */
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    height: calc(var(--bottom-nav-h) + var(--safe-bottom));
    padding: .35rem .4rem var(--safe-bottom);
    background: rgba(255,255,255,.94);
    backdrop-filter: saturate(1.5) blur(20px);
    -webkit-backdrop-filter: saturate(1.5) blur(20px);
    border-top: 1px solid rgba(226,232,237,.95);
    box-shadow: 0 -8px 32px rgba(15,28,36,.08);
    justify-content: space-around;
    align-items: flex-start;
  }
  .bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: .35rem .15rem;
    color: #7a8b96;
    font-size: .62rem;
    font-weight: 600;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    border-radius: 12px;
  }
  .bottom-nav a.active { color: var(--ink); }
  .bottom-nav a span.tab-label { line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* FAB — hızlı işlem */
  .fab {
    display: flex;
    position: fixed;
    right: 1rem;
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + .75rem);
    z-index: 45;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #14b8a6, #0d7377);
    color: #fff;
    box-shadow:
      0 1px 0 rgba(255,255,255,.35) inset,
      0 10px 28px rgba(13,115,119,.45);
    border: none;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .fab:active { transform: scale(.92); }
  .fab svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.2)); }

  .fab-menu {
    display: none;
    position: fixed;
    right: 1rem;
    bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 5rem);
    z-index: 46;
    flex-direction: column;
    gap: .55rem;
    align-items: flex-end;
  }
  .fab-menu.open { display: flex; }
  .fab-menu a {
    display: flex;
    align-items: center;
    gap: .65rem;
    background: #fff;
    padding: .45rem .75rem .45rem .45rem;
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(15,28,36,.14);
    color: var(--ink);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    animation: fabIn .22s ease both;
  }
  @keyframes fabIn {
    from { opacity: 0; transform: translateY(8px) scale(.9); }
    to { opacity: 1; transform: none; }
  }

  .menu-toggle {
    display: grid;
    width: 42px; height: 42px;
    border-radius: 12px;
    background: #f1f5f7;
    place-items: center;
    font-size: 1.15rem;
  }

  /* Mobil kart listesi (tablolar yerine soft görünüm) */
  .mobile-cards { display: none; }

  .auth-page {
    padding: 1.25rem;
    padding-top: max(1.25rem, var(--safe-top));
    min-height: 100dvh;
  }
  .auth-card {
    border: none;
    border-radius: 22px;
    padding: 1.5rem;
    box-shadow: 0 12px 40px rgba(15,28,36,.1);
  }

  /* Landing mobil */
  .site-nav .inner { height: 58px; }
  .nav-cta .btn-sm { padding: .55rem .85rem; }
  .hero { min-height: auto; }
  .hero-content { padding: 2.5rem 0 3rem; }
  .hero .brand-hero { font-size: clamp(2.4rem, 12vw, 3.4rem); }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; min-height: 52px; }
  .section { padding: 3rem 0; }
  .feature-grid { gap: .85rem; }
  .feature { border-radius: 18px; border: none; box-shadow: 0 4px 16px rgba(15,28,36,.05); }
  .pricing-grid { gap: .85rem; }
  .price-card { border-radius: 18px; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .site-footer { padding-bottom: calc(2rem + var(--safe-bottom)); }
}

@media (min-width: 1025px) {
  .bottom-nav, .fab, .fab-menu, .sidebar-overlay { display: none !important; }
  .app-grid { grid-template-columns: repeat(6, 1fr); max-width: 720px; }
}

/* Daha küçük telefonlar */
@media (max-width: 380px) {
  .app-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .bottom-nav a span.tab-label { font-size: .58rem; }
}
