/* ════════════════════════════════════════════════════════════════════
   SahaShift Web Panel — Responsive / PWA / Touch (2026-05-07)
   ────────────────────────────────────────────────────────────────────
   Hedef: telefon (320-480), tablet (481-1024), laptop (1025-1440),
          desktop (1441+)

   Pattern:
   1. Tablolar 768px altında ".data-table" otomatik KART layout'a dönüşür.
      Her satır bir kart, her hücre "label: değer" satırı.
      Label: <th> textContent'inden auto (JS helper) veya data-label attr.
   2. Page-header butonları wrap olur.
   3. Modallar 480px altında full-screen.
   4. Form input'ları 16px font-size (iOS Safari zoom önleme).
   5. Touch target minimum 44x44px.
   ════════════════════════════════════════════════════════════════════ */

/* ─── Touch-friendly defaults ─── */
@media (hover: none) and (pointer: coarse) {
  /* Mobile/tablet: hover state'leri active'e çevir, touch target büyüt */
  .btn, .btn-icon, button, [role="button"] {
    min-height: 44px;
    min-width: 44px;
  }
  .btn-sm { min-height: 36px; min-width: 36px; }
  .btn-icon { padding: 10px; }
  /* iOS Safari: 16px altı font-size input'ta zoom yapar */
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* ─── Page-header responsive ─── */
@media (max-width: 900px) {
  .page-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px !important;
  }
  .page-header > div:last-child {
    width: 100%;
    flex-wrap: wrap;
  }
  .page-title {
    font-size: 18px !important;
  }
  .page-subtitle {
    font-size: 12px !important;
  }
  .page-content { padding: 12px !important; }
}

/* ─── Filter bar / toolbar ─── */
@media (max-width: 900px) {
  .filter-bar, .toolbar, .filter-group {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .filter-bar select,
  .filter-bar input,
  .filter-bar button,
  .toolbar select,
  .toolbar input,
  .toolbar button {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ─── DATA TABLE → KART LAYOUT (mobile) ─── */
@media (max-width: 900px) {
  /* Sarmalayıcı: yatay scroll engel */
  .data-table-wrapper,
  .data-table {
    display: block !important;
    width: 100% !important;
  }
  .data-table {
    border-collapse: separate !important;
  }
  .data-table thead {
    /* Header gizle — kart layout'unda her hücrenin kendi label'ı var */
    display: none !important;
  }
  .data-table tbody,
  .data-table tr {
    display: block !important;
    width: 100% !important;
  }
  .data-table tbody tr {
    background: var(--card-bg, #fff) !important;
    border: 1px solid var(--border, #e5e7eb) !important;
    border-radius: 10px !important;
    margin-bottom: 10px !important;
    padding: 10px 12px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
  }
  .data-table tbody tr:hover {
    background: var(--card-bg, #fff) !important;
  }
  .data-table tbody tr.selected {
    border-color: var(--accent, #2d6be4) !important;
    background: rgba(45,107,228,0.04) !important;
  }
  .data-table tbody td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 6px 0 !important;
    border: none !important;
    border-bottom: 1px dashed var(--border, #f0f0f0) !important;
    text-align: right !important;
    font-size: 13px !important;
    min-height: 36px;
    word-break: break-word;
  }
  .data-table tbody td:last-child {
    border-bottom: none !important;
    padding-top: 8px !important;
  }
  .data-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    text-align: left;
    flex: 0 0 auto;
    margin-right: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  /* FIX (2026-05-07): Compact-card mode — mobile'da varsayılan olarak
     ilk 2 alan (genelde ad + 1 önemli bilgi) + son alan (actions) görünür.
     Diğer alanlar collapsed; satıra tap edince tr.expanded ile tümü açılır.
     CSS-only: JS responsive.js içinde tr click handler ekler. */
  .data-table tbody tr {
    cursor: pointer;
    position: relative;
    padding-right: 32px !important;
  }
  /* Sağ üst köşede chevron — kullanıcıya "tıklanabilir" sinyali */
  .data-table tbody tr::after {
    content: 'expand_more';
    font-family: 'Material Icons Round';
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 22px;
    color: var(--text-muted, #94a3b8);
    transition: transform 0.2s;
    pointer-events: none;
  }
  .data-table tbody tr.expanded::after {
    transform: rotate(180deg);
  }
  /* 3. ve sonraki td'leri gizle — sadece ilk 2 + son görünür */
  .data-table tbody tr td:nth-child(n+3) {
    display: none !important;
  }
  /* Action sütunu (genelde son) her zaman görünür */
  .data-table tbody tr td:last-child {
    display: flex !important;
  }
  /* Expanded → tüm td'ler görünür */
  .data-table tbody tr.expanded td {
    display: flex !important;
  }

  /* Sayfa-spesifik kart başlığı sütunları (kullanıcı isteği 2026-05-07).
     Default: 1. + son. Aşağıdaki sayfalar ek sütunlar gösterir. */

  /* Avans: İşçi(1) | Şantiye(2) | Tutar(3) | ... | Durum(7) | İşlem(8) */
  #advances-table tbody tr td:nth-child(3),  /* Tutar */
  #advances-table tbody tr td:nth-child(7) { /* Durum */
    display: flex !important;
  }

  /* İzin: İşçi(1) | Tür(2) | Tarih(3) | Süre(4) | Sebep(5) | Durum(6) | Talep(7) | İşlem(8) */
  #leaves-table tbody tr td:nth-child(3),  /* Tarih */
  #leaves-table tbody tr td:nth-child(4),  /* Süre */
  #leaves-table tbody tr td:nth-child(6) { /* Durum */
    display: flex !important;
  }

  /* Bordro: İşçi(1) | Dönem(2) | Talep Tarihi(3) | Sebep(4) | Durum(5) | İşlem(6) */
  #payslips-table tbody tr td:nth-child(2), /* Dönem */
  #payslips-table tbody tr td:nth-child(5) { /* Durum */
    display: flex !important;
  }

  /* Harçırah: İşçi(1) | Şantiye(2) | Dönem(3) | Tip(4) | Tutar(5) | Tarih(6) | Durum(7) | İşlem(8) */
  #harcirah-table tbody tr td:nth-child(5), /* Tutar */
  #harcirah-table tbody tr td:nth-child(7) { /* Durum */
    display: flex !important;
  }

  /* Ödemeler: İşçi(1) | Tarih(2) | Açıklama(3) | Tutar(4) | ... */
  #payments-table tbody tr td:nth-child(2), /* Tarih */
  #payments-table tbody tr td:nth-child(4) { /* Tutar */
    display: flex !important;
  }

  /* İzin Bakiyeleri: İşçi(1) | Kıdem(2) | Yıllık Hak(3) | Kullanılan(4) | ... */
  #leaves-balance-table tbody tr td:nth-child(3), /* Yıllık Hak */
  #leaves-balance-table tbody tr td:nth-child(4) { /* Kullanılan */
    display: flex !important;
  }
  /* İlk td (genelde checkbox/avatar) → kompakt mode'da büyük başlık gibi davransın */
  .data-table tbody tr td:first-child {
    font-size: 14px !important;
    font-weight: 600 !important;
    border-bottom: 1px solid var(--border, #e5e7eb) !important;
    padding-bottom: 8px !important;
  }
  .data-table tbody tr td:first-child::before {
    /* İlk hücrede label gizle — başlık zaten kendisi */
    display: none;
  }
  /* Expanded'da ilk td label tekrar görünür */
  .data-table tbody tr.expanded td:first-child::before {
    display: flex;
  }
  /* Boş data-label hiç gösterme (örn checkbox satırı) */
  .data-table tbody td[data-label=""]::before {
    content: "";
    margin: 0;
  }
  /* Action butonları satırı tam genişlik */
  .data-table tbody td.actions,
  .data-table tbody td:has(.btn-icon),
  .data-table tbody td:has(.btn) {
    justify-content: flex-end !important;
  }
  /* Avatar/checkbox sütunu inline */
  .data-table tbody td .cell-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }
}

/* ─── Modal mobile full-screen ─── */
/* FIX (2026-05-07): Eski versiyonda align-items:flex-end + max-height:95vh
   ile bottom sheet idi, ama uzun formlarda üst kısmı (header + X butonu)
   ekran dışına taşıyordu. Şimdi full-screen + flex column + sticky
   header/footer + body scroll. */
@media (max-width: 900px) {
  .modal-overlay {
    padding: 0 !important;
    align-items: stretch !important;
  }
  .modal-container {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    height: 100vh !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  .modal-header {
    flex: 0 0 auto !important;
    padding-top: calc(20px + env(safe-area-inset-top)) !important;
    background: var(--modal-bg, #fff);
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .modal-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 16px !important;
  }
  .modal-footer {
    flex: 0 0 auto !important;
    flex-direction: column-reverse !important;
    gap: 8px !important;
    padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
    background: var(--modal-bg, #fff);
    position: sticky;
    bottom: 0;
    z-index: 2;
    border-top: 1px solid var(--border-light, #e5e7eb);
  }
  .modal-footer .btn {
    width: 100% !important;
  }
}

/* ─── Form input mobile ─── */
@media (max-width: 900px) {
  .form-group {
    margin-bottom: 12px !important;
  }
  .form-input,
  .form-select,
  .form-control,
  input.form-control,
  select.form-control,
  textarea.form-control {
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* ─── Cards / grid responsive ─── */
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .card { border-radius: 10px !important; }
  .card-body { padding: 12px !important; }
  .card-header { padding: 12px !important; }
}

/* Tablet 481-1024 */
@media (min-width: 481px) and (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ─── Header mobile ─── */
@media (max-width: 900px) {
  .header {
    padding: 0 12px !important;
    height: 56px !important;
  }
  .header-greeting,
  .header-greeting h2 {
    font-size: 14px !important;
  }
  .header-actions {
    gap: 6px !important;
  }
  .header-search {
    display: none !important;
  }
  .header-search-mobile-btn {
    display: flex !important;
  }
}

/* ─── Tab bar mobile ─── */
@media (max-width: 900px) {
  .tabs {
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }
  .tab {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }
}

/* ─── Tabs scroll için scrollbar gizleme ─── */
.tabs::-webkit-scrollbar { display: none; }
.tabs { -ms-overflow-style: none; scrollbar-width: none; }

/* ─── Inventory editable grid mobile (2026-05-07 iterasyon 2) ─── */
/* Strateji: her satırı dikey istif kart yap; her hücre kendi label'ı ile
   görünür. Input/select'ler tam genişlik. Compact-card pattern'inin
   "tap-to-expand" davranışı YOK (her zaman tüm field'lar açık).
   Wrapper'ın yatay scroll'unu kapat. */
@media (max-width: 900px) {
  /* Wrapper yatay scroll iptal — kart layout zaten ekrana sığar */
  #inv-container .card-body > div[style*="overflow-x"] {
    overflow-x: visible !important;
  }
  /* Tablo block, header gizli */
  #consumables-table,
  #hand-tools-table {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  #consumables-table thead,
  #hand-tools-table thead {
    display: none !important;
  }
  #consumables-table tbody,
  #hand-tools-table tbody {
    display: block !important;
    width: 100% !important;
  }
  /* Her satır kart */
  #consumables-table tbody tr,
  #hand-tools-table tbody tr {
    display: block !important;
    width: 100% !important;
    cursor: default !important;
    padding: 12px !important;
    margin-bottom: 10px !important;
    background: var(--card-bg, #fff) !important;
    border: 1px solid var(--border, #e5e7eb) !important;
    border-radius: 10px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04) !important;
  }
  /* Compact-card chevron envanterde gerek yok (her şey hep açık) */
  #consumables-table tbody tr::after,
  #hand-tools-table tbody tr::after {
    display: none !important;
  }
  /* Her hücre dikey blok — label üstte, input altta */
  #consumables-table tbody td,
  #hand-tools-table tbody td {
    display: block !important;
    width: 100% !important;
    padding: 6px 0 !important;
    border: none !important;
    border-bottom: 1px dashed var(--border, #f0f0f0) !important;
    text-align: left !important;
    min-height: 0 !important;
  }
  #consumables-table tbody td:last-child,
  #hand-tools-table tbody td:last-child {
    border-bottom: none !important;
    padding-top: 10px !important;
  }
  /* Label üstte (kompakt-card pattern'i ile aynı ama display:block) */
  #consumables-table tbody td::before,
  #hand-tools-table tbody td::before {
    content: attr(data-label) !important;
    display: block !important;
    font-weight: 600 !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    color: var(--text-muted, #6b7280) !important;
    margin-bottom: 4px !important;
    text-align: left !important;
  }
  /* İlk hücre (Ad) — kart başlığı tarzı, label gizli */
  #consumables-table tbody td:first-child,
  #hand-tools-table tbody td:first-child {
    font-size: 15px !important;
    font-weight: 700 !important;
    border-bottom: 1px solid var(--border, #e5e7eb) !important;
    padding-bottom: 10px !important;
    margin-bottom: 4px !important;
  }
  #consumables-table tbody td:first-child::before,
  #hand-tools-table tbody td:first-child::before {
    display: none !important;
  }
  /* Input/select tam genişlik */
  #consumables-table tbody td input,
  #consumables-table tbody td select,
  #hand-tools-table tbody td input,
  #hand-tools-table tbody td select {
    width: 100% !important;
    box-sizing: border-box !important;
    border: 1px solid var(--border, #e5e7eb) !important;
    background: #fff !important;
    padding: 8px 10px !important;
    font-size: 14px !important;
    border-radius: 6px !important;
    text-align: left !important;
  }
  /* Number input mobile'da sağ-aligne yapma — okuma kolaylığı */
  #consumables-table tbody td input[type="number"],
  #hand-tools-table tbody td input[type="number"] {
    text-align: left !important;
  }
  /* Action butonları satırı — yatay grup, kompakt */
  #consumables-table tbody td:last-child,
  #hand-tools-table tbody td:last-child {
    display: flex !important;
    flex-wrap: wrap;
    gap: 4px !important;
    justify-content: flex-start !important;
    padding-top: 8px !important;
    margin-top: 4px !important;
    border-top: 1px solid var(--border, #f0f0f0) !important;
  }
  /* "İŞLEM" label gereksiz — ikonlar zaten anlamlı, satırı kısaltsın */
  #consumables-table tbody td:last-child::before,
  #hand-tools-table tbody td:last-child::before {
    display: none !important;
  }
  /* Butonları kompakt: touch-friendly default 44x44 → 36x36 (envanter kartı için) */
  #consumables-table tbody td:last-child .btn-icon,
  #hand-tools-table tbody td:last-child .btn-icon {
    min-width: 36px !important;
    min-height: 36px !important;
    width: 36px !important;
    height: 36px !important;
    padding: 6px !important;
    border-radius: 6px !important;
    background: var(--bg-subtle, #f3f4f6) !important;
  }
  #consumables-table tbody td:last-child .btn-icon .material-icons-round,
  #hand-tools-table tbody td:last-child .btn-icon .material-icons-round {
    font-size: 18px !important;
  }
  /* Toolbar (Ad arama / + Satır Ekle / Excel butonları) sayfa içinde sıkışmasın */
  #inv-container .card-header {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
  #inv-container .card-header > div:last-child {
    width: 100%;
    flex-wrap: wrap;
  }
  #inv-container .card-header .btn {
    flex: 1 1 auto;
  }
}

/* ─── Driver tasks card → mobile zaten OK ─── */
@media (max-width: 480px) {
  .grid-2 { grid-template-columns: 1fr !important; }
}

/* ─── Stat cards mobile ─── */
@media (max-width: 900px) {
  .stat-card {
    padding: 14px !important;
  }
  .stat-value {
    font-size: 20px !important;
  }
}

/* ─── Status badge — mobile metin küçült ─── */
@media (max-width: 480px) {
  .status-badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
  }
}

/* ─── Pagination mobile ─── */
@media (max-width: 480px) {
  .pagination {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
  .pagination button {
    min-width: 36px !important;
    padding: 6px 8px !important;
    font-size: 12px !important;
  }
}

/* ─── Sidebar mobile (mevcut — ek polish) ─── */
@media (max-width: 900px) {
  .sidebar.mobile-open {
    width: min(280px, 80vw) !important;
    /* FIX (2026-05-07): Leaflet pane'leri z-index 200-800 arası, sidebar
       eski z-index:30 idi → canlı konum sayfasında menü harita arkasında
       kalıyordu. 9999'a çıkar — overlay 9998. */
    z-index: 9999 !important;
  }
  .sidebar-overlay {
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
    z-index: 9998 !important;
  }
}

/* ─── Worker profile detail mobile ─── */
@media (max-width: 900px) {
  .worker-profile-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .worker-profile-tabs {
    overflow-x: auto !important;
  }
}

/* ─── Mobile-only utility classes ─── */
.mobile-only { display: none !important; }
.mobile-hidden { }
@media (max-width: 900px) {
  .mobile-only { display: revert !important; }
  .mobile-hidden { display: none !important; }
}

/* ─── Yatay scroll için pratik wrapper ─── */
.h-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ─── Saat gizle (web + mobile, kullanıcı isteği 2026-05-07) ─── */
#header-clock,
#header-clock-wrap,
.header-clock,
.header-clock-wrap,
.dashboard-clock,
.live-clock,
[data-clock="true"] {
  display: none !important;
}

/* Tab toggle kaldırıldı (over-engineering) — harita+liste yan yana, mobile'da
   harita küçük + liste büyük yaklaşımı (aşağıdaki @media kuralında). */
.lm-mobile-toggle { display: none !important; }

/* ─── Giderler filtre düzeni mobile (2x2 grid) ─── */
@media (max-width: 900px) {
  #expenses-filter-card .card-body {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    align-items: stretch !important;
  }
  #expenses-filter-card .card-body .form-group {
    min-width: 0 !important;
    flex: none !important;
    margin: 0 !important;
  }
  #expenses-filter-card .card-body select,
  #expenses-filter-card .card-body input {
    width: 100% !important;
  }
  /* Şantiye + Kategori tam genişlik (önemli filtreler) */
  #expenses-filter-card .card-body > div:nth-child(1),
  #expenses-filter-card .card-body > div:nth-child(4) {
    grid-column: 1 / -1 !important;
  }
  /* Temizle butonu son satır, ortalanmış */
  #expenses-filter-card .card-body > button {
    grid-column: 1 / -1 !important;
    justify-self: end !important;
    height: 38px !important;
  }
}

/* ─── Şantiye Düzenle (site-edit) mobile fix ─── */
/* Mobile'da sticky kaydet şeridi parent overflow nedeniyle kırılıyordu →
   fixed + safe-area + içeriğe bottom padding. */
@media (max-width: 900px) {
  .se-actions {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 12px 14px !important;
    padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    border-radius: 0 !important;
    background: var(--card-bg, #ffffff) !important;
    z-index: 100 !important;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.1) !important;
    flex-wrap: wrap;
  }
  .se-actions .btn {
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  /* Sayfanın altına boşluk — fixed bar içerik üstüne binmesin */
  .se-grid {
    padding-bottom: 96px !important;
  }
  /* Site-edit grid mobile'da tek kolon */
  .se-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  /* Harita mobile'da daha kısa */
  #se-map {
    height: 280px !important;
  }
  /* Workers list maks-yükseklik kısalt */
  .se-workers {
    max-height: 240px !important;
  }
  /* Mode tabs scroll'lu */
  .se-mode-tabs {
    overflow-x: auto;
    flex-wrap: nowrap !important;
  }
  .se-mode-tabs::-webkit-scrollbar { display: none; }
  .se-mode-tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* ─── Live map (Canlı Konum) mobile fix ─── */
@media (max-width: 900px) {
  /* Wrapper tam ekran (mobile header 56px düş) — dvh URL bar dinamik */
  .livemap-wrapper {
    height: calc(100vh - 56px) !important;
    height: calc(100dvh - 56px) !important;
  }
  /* Map + side panel container'ı dikey istif */
  .livemap-wrapper > div:nth-of-type(2) {
    flex-direction: column !important;
  }
  /* Harita küçük — liste için bol yer */
  #livemap-canvas {
    flex: 0 0 38vh !important;
    height: 38vh !important;
    min-height: 200px !important;
    width: 100% !important;
  }
  /* İşçi listesi alt — kalan tüm alanı kaplar, scroll'lu */
  #livemap-list {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-height: none !important;
    min-height: 200px;
    border-left: none !important;
    border-top: 1px solid #1e293b !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: block !important;
  }
  /* Toolbar daha kompakt */
  .livemap-wrapper > div:first-child {
    padding: 10px 12px !important;
    gap: 8px !important;
  }
  .livemap-wrapper > div:first-child h2 {
    font-size: 15px !important;
    flex: 1 1 100%;
  }
  /* Filter chip'leri scroll'lu yatay liste */
  #livemap-counts {
    flex: 1 1 100% !important;
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  #livemap-counts::-webkit-scrollbar { display: none; }
  .lm-count {
    flex: 0 0 auto !important;
    font-size: 11px !important;
    padding: 3px 10px !important;
  }
  /* Sağ üst toolbar grubu (search, site filter, butonlar) tam genişlik */
  .livemap-wrapper > div:first-child > div:last-child {
    margin-left: 0 !important;
    width: 100%;
    flex-wrap: wrap;
  }
  #lm-site-filter,
  #lm-search {
    flex: 1 1 140px !important;
    min-width: 0 !important;
    width: auto !important;
  }
  #lm-fit, #lm-refresh {
    flex: 0 0 auto !important;
  }
}

/* Approvals + driver-tasks — kart bazlı, dokunma değişikliği yok */

/* ─── Login/register mobile ─── */
@media (max-width: 480px) {
  .auth-card,
  .login-card,
  .register-card {
    padding: 20px !important;
    margin: 16px !important;
    width: calc(100% - 32px) !important;
  }
}

/* ─── PWA standalone modunda extra padding (iOS notch) ─── */
@media (display-mode: standalone) {
  .header {
    padding-top: env(safe-area-inset-top) !important;
    height: calc(56px + env(safe-area-inset-top)) !important;
  }
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
