/* Telefon okunabilirliği (v2.1.0). app.css'ten sonra yüklenir; yalnız dar ekranları etkiler.
   Masaüstü görünümü ve yazdırma/PDF çıktıları değişmez (yazdırma ayrı pencerede kendi stilini kullanır). */
/* Puantajda görev adı yalnız telefonda adın altında gösterilir */
.att-gorev { display: none; }

@media (max-width: 760px) {
  /* Üst şerit: telefonda sabit kalıp ekranın yedide birini kaplamasın; sayfayla birlikte kaysın */
  .topbar { position: relative; }
  /* iPhone, 16px'ten küçük yazı alanına dokununca sayfayı büyütür; alanlar 16px olunca bu durur */
  input, select, textarea,
  #page.compact-module input, #page.compact-module select, #page.compact-module textarea {
    font-size: 16px !important;
  }
  #page.compact-module input:not([type=checkbox]):not([type=radio]), #page.compact-module select { min-height: 44px; }

  /* Genel yazılar: telefonda en küçük okunur boyut 13–15px */
  #page { font-size: 15px; }
  #page.compact-module label { font-size: 14px; line-height: 1.3; }
  #page.compact-module .small, #page .small, #page .muted { font-size: 13px; line-height: 1.4; }
  #page.compact-module .page-title h1 { font-size: 22px; }
  #page.compact-module .page-title p { font-size: 13px; line-height: 1.4; }
  #page.compact-module .card h2 { font-size: 18px; }
  #page.compact-module .card h3 { font-size: 16px; }
  #page.compact-module .notice, #page.compact-module .error, #page.compact-module .success { font-size: 14px; line-height: 1.45; }
  #page.compact-module summary { font-size: 15px; padding: 6px 0; }
  #page .badge, #page.compact-module .badge { font-size: 12px; padding: 4px 8px; }
  #page.compact-module .kpi span { font-size: 13px; }
  #page.compact-module .kpi b { font-size: 22px; }

  /* Dokunma hedefleri: parmakla rahat basılacak yükseklik */
  #page .btn, #page.compact-module .btn { min-height: 44px; font-size: 15px; padding: 9px 14px; }
  #page .smallbtn, #page.compact-module .smallbtn { min-height: 38px; font-size: 14px; padding: 7px 11px; }
  #page.compact-module .tab, #page .tab { min-height: 42px; font-size: 15px; padding: 9px 13px; }

  /* Tablolar: yazı okunur boyutta, yatay kaydırma korunur */
  #page table, #page.compact-module table { font-size: 14px; }
  #page th, #page.compact-module th { font-size: 13px; }
  #page td, #page th { padding: 8px 7px; }

  /* Puantaj tablosu: telefonda tablo görünümü korunur, ekrana sığar.
     Kod, Görev (adın altına taşınır), Normal saat ve Kaynak sütunları gizlenir; fazla mesai nedeni varsa satırın altına iner. */
  #page table.att-table { min-width: 0 !important; width: 100%; font-size: 14px; }
  #page table.att-table thead tr, #page table.att-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) 92px 56px; column-gap: 6px; align-items: center; }
  #page table.att-table thead, #page table.att-table tbody { display: block; }
  #page table.att-table tbody tr { border-bottom: 1px solid #eef0f4; padding: 7px 0; }
  #page table.att-table th, #page table.att-table td { display: block; padding: 0 2px; border: 0; min-width: 0; }
  #page table.att-table th { padding-bottom: 6px; }
  #page table.att-table th:nth-child(1), #page table.att-table td:nth-child(1),
  #page table.att-table th:nth-child(3), #page table.att-table td:nth-child(3),
  #page table.att-table th:nth-child(5), #page table.att-table td:nth-child(5),
  #page table.att-table th:nth-child(7),
  #page table.att-table th:nth-child(8), #page table.att-table td:nth-child(8),
  #page table.att-table td.att-bos { display: none; }
  #page table.att-table td:nth-child(6), #page table.att-table th:nth-child(6) { text-align: right; white-space: nowrap; }
  #page table.att-table td:nth-child(2) { line-height: 1.25; overflow-wrap: anywhere; }
  #page table.att-table .att-gorev { display: block; font-size: 12px; color: var(--muted); }
  #page table.att-table td:nth-child(4) .badge { font-size: 11px; padding: 3px 6px; white-space: nowrap; }
  #page table.att-table td:nth-child(7) { grid-column: 1 / -1; padding-top: 6px; }
  #page table.att-table td[colspan] { grid-column: 1 / -1; display: block; }

  /* Günlük Rapor penceresi: telefonda tam ekran, üst çubuk en üste yapışık */
  #dailyReportModal { padding: 0 !important; }
  #dailyReportModal .rep-pencere { width: 100% !important; min-height: 100%; border-radius: 0 !important; padding: 0 10px 14px !important; box-shadow: none !important; }
  #dailyReportModal .rep-ust { display: flex !important; justify-content: space-between; align-items: center; margin: 0 -10px; padding: 8px 10px !important; padding-top: calc(8px + env(safe-area-inset-top, 0px)) !important; border-bottom: 1px solid #e2e8f0; }
  [data-report-card] > div[style*="padding:16px"] { padding: 12px 10px !important; }
  /* Başlık: logo ve başlık yan yana, tarih ve durum alt satırda; hiçbir şey kesilmez */
  .rep-baslik { grid-template-columns: 64px minmax(0, 1fr) !important; gap: 8px 10px !important; padding: 12px 10px !important; }
  .rep-baslik img { max-width: 60px !important; max-height: 40px !important; }
  .rep-baslik > div:nth-child(2) { text-align: left !important; }
  .rep-baslik > div:nth-child(2) > div:first-child { font-size: 17px !important; }
  .rep-baslik > div:nth-child(3) { grid-column: 1 / -1; text-align: left !important; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .rep-baslik > div:nth-child(3) > div { margin-top: 0 !important; }
  /* Hava / Sıcaklık / Çalışma Saatleri hemen altındaki formda zaten var */
  .rep-ozet { display: none !important; }

  /* Rapor personel tablosu: Personel | Durum | FM, açıklama satırın altında; No ve Normal saat gizli */
  #page table.rep-pers, #dailyReportModal table.rep-pers { min-width: 0 !important; width: 100%; }
  table.rep-pers thead, table.rep-pers tbody { display: block; }
  table.rep-pers tr { display: grid; grid-template-columns: minmax(0, 1fr) 118px 64px; grid-template-areas: "ad durum fm" "meslek meslek meslek" "ekip ekip ekip" "neden neden neden"; column-gap: 6px; row-gap: 4px; align-items: center; padding: 7px 4px; border-bottom: 1px solid #eef0f4; }
  table.rep-pers thead tr, table.rep-arac thead tr { background: #f4f3fb; }
  table.rep-pers th, table.rep-arac th { background: transparent !important; }
  table.rep-pers th, table.rep-pers td { display: block; padding: 0 !important; border: 0 !important; min-width: 0; }
  table.rep-pers .rp-no, table.rep-pers .rp-normal, table.rep-pers th.rp-ekip, table.rep-pers th.rp-meslek, table.rep-pers th.rp-neden, table.rep-pers .rp-bos { display: none !important; }
  table.rep-pers .rp-ad { grid-area: ad; line-height: 1.25; overflow-wrap: anywhere; }
  table.rep-pers .rp-meslek { grid-area: meslek; font-size: 12px; color: var(--muted); }
  table.rep-pers .rp-ekip { grid-area: ekip; font-size: 12px; color: var(--muted); }
  table.rep-pers .rp-durum { grid-area: durum; }
  table.rep-pers .rp-fm { grid-area: fm; text-align: right; }
  table.rep-pers th.rp-fm { font-size: 0; } table.rep-pers th.rp-fm::after { content: "FM"; font-size: 13px; }
  table.rep-pers .rp-neden { grid-area: neden; }
  table.rep-pers td[colspan] { grid-column: 1 / -1; }
  table.rep-pers select, table.rep-pers input { width: 100%; min-width: 0 !important; padding-left: 8px; padding-right: 8px; }

  /* Rapor araç tablosu: Plaka | Ad (tipi altında) | Günlük Durum; No ve Kod gizli */
  #page table.rep-arac, #dailyReportModal table.rep-arac { min-width: 0 !important; width: 100%; }
  table.rep-arac thead, table.rep-arac tbody { display: block; }
  table.rep-arac tr { display: grid; grid-template-columns: 98px minmax(0, 1fr) 118px; grid-template-areas: "plaka ad durum" "plaka tip durum"; column-gap: 6px; align-items: center; padding: 7px 4px; border-bottom: 1px solid #eef0f4; }
  table.rep-arac thead tr { grid-template-areas: "plaka ad durum"; }
  table.rep-arac th, table.rep-arac td { display: block; padding: 0 !important; border: 0 !important; min-width: 0; }
  table.rep-arac .ra-no, table.rep-arac .ra-kod, table.rep-arac th.ra-tip { display: none !important; }
  table.rep-arac .ra-plaka { grid-area: plaka; white-space: nowrap; }
  table.rep-arac .ra-ad { grid-area: ad; line-height: 1.25; overflow-wrap: anywhere; }
  table.rep-arac td.ra-tip { grid-area: tip; font-size: 12px; color: var(--muted); }
  table.rep-arac .ra-durum { grid-area: durum; }
  table.rep-arac th.ra-durum { font-size: 0; } table.rep-arac th.ra-durum::after { content: "Durum"; font-size: 13px; }
  table.rep-arac td[colspan] { grid-column: 1 / -1; }
  table.rep-arac select { width: 100%; min-width: 0 !important; padding-left: 8px; padding-right: 8px; }
}
