/* =========================================================
   EFLİS RESPONSIVE — son katman (2026-10-08)
   Masaüstü kuralları değiştirilmez; yalnız tablet/telefon
   kırılımlarında taşan veya sıkışan alanlar düzeltilir.
   Modüller kendi <style> bloklarını sonradan eklediği için
   gereken yerlerde !important kullanılmıştır.
   ========================================================= */

/* ---------- Tablet (≤ 1024px) ---------- */
@media screen and (max-width:1024px){
  #applicationContent img,#eflParentApp img{max-width:100%}
  .duty-board,.cm-grid,.exam-table-wrap,.re-table-wrap{-webkit-overflow-scrolling:touch}
}

/* ---------- Telefon (≤ 760px) ---------- */
@media screen and (max-width:760px){

  /* Uzun buton metinleri ekranı genişletmesin */
  #applicationContent .ef-action,
  #applicationContent .btn,
  #eflParentApp .btn{
    white-space:normal!important;
    max-width:100%!important;
    height:auto;
    line-height:1.25;
  }

  /* İdareci Paneli: "Sınıf seçin + uzun buton" satırları */
  .security-actions{flex-wrap:wrap!important}
  .security-actions>select{flex:1 1 140px;min-width:0}
  .security-actions>.ef-action,
  .security-actions>button{flex:1 1 100%;text-align:center;justify-content:center}

  /* Duyurularım penceresi telefonda ekrandan taşmasın */
  .eflis-ann-modal{padding:10px!important}
  .eflis-ann-dialog{
    width:100%!important;max-width:760px!important;
    max-height:calc(100dvh - 20px)!important;border-radius:18px!important
  }
  .eflis-ann-head{padding:14px 14px!important;gap:10px}
  .eflis-ann-head h2{font-size:21px!important}

  /* Nöbet tablosu: gün başlıkları üst üste binmesin, yatay kaydırılsın */
  .duty-board{overflow-x:auto!important;overscroll-behavior-x:contain}
  .duty-board .duty-table{min-width:640px}
  .duty-table th,.duty-table td{white-space:nowrap}

  /* Özet kutuları telefonda iki sütun (tek sütun gereksiz uzun) */
  .dash-summary,.student-dashboard-summary,.teacher-dashboard-summary,
  .notify-summary,.cm-statgrid,.efl-req-stats,.report-summary,
  body.efl-admin-active #applicationContent .dash-summary,
  body.efl-admin-active #applicationContent .notify-summary,
  body.efl-admin-active #applicationContent .report-summary{
    grid-template-columns:repeat(2,minmax(0,1fr))!important
  }
  .dash-stat,.notify-stat{min-width:0!important}
  .dash-stat span{min-height:0!important}

  /* Sekme/filtre düğme grupları yatay akışta kalsın */
  .proj-filter,.teacher-filter,.adm-tabs,.tabs{flex-wrap:wrap}

  /* Veli paneli üst bandı — ana başlıkla aynı kompakt düzen */
  #eflis-parent-header.parent-topbar{
    height:58px!important;min-height:58px!important;
    padding:5px 9px!important;gap:6px!important;overflow:hidden!important
  }
  #eflis-parent-header .parent-brand{gap:6px!important;min-width:0!important;flex:1 1 auto!important}
  #eflis-parent-header .parent-menu-modern{
    width:36px!important;height:36px!important;flex:0 0 36px!important;
    min-width:36px!important;min-height:36px!important;padding:0!important;
    font-size:19px!important;border-radius:10px!important
  }
  #eflis-parent-header .parent-logo-modern{
    width:42px!important;height:42px!important;flex:0 0 42px!important;
    min-width:42px!important;transform:none!important;margin:0!important
  }
  #eflis-parent-header .parent-brand-copy{min-width:0!important;overflow:hidden!important}
  #eflis-parent-header .parent-brand-copy b{
    font-size:clamp(10px,2.9vw,13px)!important;white-space:nowrap!important;
    overflow:hidden!important;text-overflow:ellipsis!important
  }
  #eflis-parent-header .parent-role-modern{font-size:9px!important;margin:0!important}
  #eflis-parent-header .parent-location{
    font-size:9px!important;margin-top:1px!important;white-space:nowrap!important;
    overflow:hidden!important;text-overflow:ellipsis!important
  }
  #eflis-parent-header .parent-actions{gap:3px!important;flex:0 0 auto!important}
  #eflis-parent-header .parent-student-select{display:none!important}
  #eflis-parent-header .parent-action-modern{
    width:36px!important;min-width:36px!important;height:36px!important;
    min-height:36px!important;padding:0!important;border-radius:10px!important;
    flex:0 0 36px!important
  }
  #eflis-parent-header .parent-action-modern span{display:none!important}
  #eflis-parent-header .parent-action-modern svg{width:18px!important;height:18px!important}
  .parent-main-modern{padding:14px 12px!important}
}

/* ---------- Sosyal Kulüpler sayfası (telefon) ---------- */
@media screen and (max-width:700px){
  #eflis-clubs-header-87d{gap:6px!important;overflow:hidden!important}
  #eflis-clubs-header-87d .eflis-clubs-brand-87d{min-width:0!important;flex:1 1 auto!important;gap:6px!important}
  #eflis-clubs-header-87d .eflis-clubs-logo-87d{width:42px!important;height:42px!important;flex:0 0 42px!important}
  #eflis-clubs-header-87d .eflis-clubs-copy-87d{min-width:0!important;overflow:hidden!important}
  #eflis-clubs-header-87d .eflis-clubs-role-87d,
  #eflis-clubs-header-87d .eflis-clubs-school-87d,
  #eflis-clubs-header-87d .eflis-clubs-location-87d{
    white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important
  }
  #eflis-clubs-header-87d .eflis-clubs-school-87d{font-size:clamp(10px,2.9vw,13px)!important}
  #eflis-clubs-header-87d .eflis-clubs-role-87d,
  #eflis-clubs-header-87d .eflis-clubs-location-87d{font-size:9px!important}
  #eflis-clubs-header-87d .top-actions{flex:0 0 auto!important;gap:3px!important}
  #eflis-clubs-header-87d .top-actions button{
    width:36px!important;min-width:36px!important;height:36px!important;min-height:36px!important;
    padding:0!important;display:inline-flex!important;align-items:center!important;justify-content:center!important
  }
  #eflis-clubs-header-87d .top-actions button span{display:none!important}
  /* Sayı kutuları iki sütun */
  .cards:has(> .stat){grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  .cards:has(> .stat) .stat{min-width:0!important}
}

/* ---------- Küçük telefon (≤ 380px) ---------- */
@media screen and (max-width:380px){
  .dash-summary,.student-dashboard-summary,.teacher-dashboard-summary,
  .notify-summary,.cm-statgrid,.efl-req-stats,.report-summary{gap:8px!important}
  #eflis-parent-header .parent-logo-modern{width:37px!important;height:37px!important;flex-basis:37px!important;min-width:37px!important}
}

/* =========================================================
   MOBİL OPTİMİZASYON 2 (2026-10-09)
   Telefon taramasında bulunan düğme, form ve başlık sorunları.
   ========================================================= */

/* İstek detay penceresi: sayfa dışına eklendiği için modül stilleri ulaşmıyordu (her ekranda) */
.efl-modal .efl-modal-box{box-sizing:border-box;font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;color:#17324d}
.efl-modal button{border:0;border-radius:10px;padding:10px 14px;min-height:40px;font:700 14px/1.2 Inter,system-ui,Arial,sans-serif;cursor:pointer;white-space:nowrap}
.efl-modal button.primary{background:#0d6fa8;color:#fff}
.efl-modal button.secondary{background:#eaf2f7;color:#214e6d}
.efl-modal button.danger{background:#8f4b19;color:#fff}
.efl-modal button:hover{filter:brightness(1.05)}
.efl-modal label{display:block;font-weight:700;color:#38556b;font-size:13px;margin:14px 0 6px}
.efl-modal .efl-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}
.efl-modal .efl-req-detail>div:first-child{flex-wrap:wrap;align-items:flex-start}
.efl-modal .efl-req-detail>div:first-child>h2{flex:1 1 200px;min-width:0;margin-bottom:6px;font-size:20px;line-height:1.3;overflow-wrap:anywhere}
.efl-modal .efl-req-detail>div:first-child>div{flex:0 0 auto;margin-left:auto}

/* Veli panelinde EFLİ yalnız Ana Sayfa'da (alt sayfalarda formların üstüne biniyordu) */
body:has(#parentDrawer nav button.active:not([data-page="home"])) #eflisCombinedAssistant{display:none!important}

@media screen and (max-width:760px){
  /* Izgara sütunları içerikten (uzun seçenek, tarih alanı) genişlemesin */
  .efl-req-grid,.efl-config,.control-grid,.security-grid,.form-grid,.grid2,.re-official-meta,.cm-grid,.duty-shell,.duty-work{grid-template-columns:minmax(0,1fr)!important}
  .efl-req-card,.control-box,.security-box,.panel,.card,.club-card,.dash-section,.meal-card,.ef-survey-card,.exam-card{min-width:0!important;max-width:100%!important;box-sizing:border-box}
  #applicationContent select,#applicationContent input:not([type=checkbox]):not([type=radio]),
  #eflParentApp select,#eflParentApp input:not([type=checkbox]):not([type=radio]),
  #content select,#content input:not([type=checkbox]):not([type=radio]){max-width:100%!important;min-width:0!important;box-sizing:border-box}
  input[type=date],input[type=datetime-local],input[type=time],input[type=month]{width:100%!important}

  /* Düğme grupları alt satıra geçebilsin; tek tek düğmeler okunur kalsın */
  .actions,.efl-actions,.control-actions,.security-actions,.meal-row,.ef-survey-row,.cm-tools,.exam-actions,.duty-actions,
  .page-head .actions,.adm-actions,.re-actions,.sv-report-actions,.tabs,.duty-tabs,.filters{flex-wrap:wrap!important;gap:8px!important}
  #applicationContent button,#eflParentApp button,#content button{line-height:1.25}
  .duty-tabs .duty-tab{flex:1 1 140px!important;min-width:0!important;white-space:normal!important}
  .duty-tabs{width:auto!important;max-width:100%!important;box-sizing:border-box}
  /* Satır içi stil ile çok sütunlu kurulmuş form ızgaraları (ör. Sistem Zaman Kontrol Paneli) */
  #applicationContent [style*="grid-template-columns:1fr 1fr auto"],#applicationContent [style*="grid-template-columns: 1fr 1fr auto"]{grid-template-columns:minmax(0,1fr)!important}
  #applicationContent [style*="justify-content:space-between"][style*="display:flex"]{flex-wrap:wrap}
  .dash-alert .btn,.dash-alert button{flex:0 0 auto!important;white-space:nowrap!important}

  /* Modül başlık satırları: başlık üstte, düğmeler altta */
  .page-head,.efl-req-head,.duty-top,.adm-head,.meal-head,.re-top{flex-wrap:wrap!important;align-items:flex-start!important}
  .page-head>div:first-child,.efl-req-head>div:first-child,.duty-top>div:first-child{min-width:0;flex:1 1 220px}
  .page-head h1,.efl-req h1,.duty-top h1,.meal-head h1{overflow-wrap:anywhere;font-size:clamp(22px,6.4vw,28px)!important;line-height:1.2!important}

  /* İstek detay penceresi telefonda tam genişlik */
  .efl-modal{padding:10px!important;align-items:end!important}
  .efl-modal .efl-modal-box{width:100%!important;max-height:calc(100dvh - 20px)!important;padding:16px!important;border-radius:16px!important}
  .efl-modal .efl-req-detail>div:first-child>h2{font-size:18px}
  .efl-modal .efl-actions button{flex:1 1 140px}

  /* Tablolar sayfayı genişletmesin, kendi içinde kaysın */
  .efl-req-table,.table,.exam-report-table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
}
@media screen and (max-width:380px){
  .efl-modal .efl-req-detail>div:first-child>div{width:100%;margin-left:0}
  .efl-modal .efl-req-detail>div:first-child>div button{flex:1}
}

/* Telefonda modül üst sekmeleri: tek satır, yana kaydırılır — kurallar eflis-polish.css'te (11.10.2026) */
@media (max-width:700px){html body .ap-tabs{position:static!important}}
/* Sekme / alt sayfa geçişlerinde “Yükleniyor” yazısı yerine eski içerik soluk durur ve üstte ince çizgi akar */
.efl-loading{position:relative;opacity:.55;pointer-events:none;transition:opacity .15s}
.efl-loading::before{content:"";position:absolute;left:0;right:0;top:-2px;height:3px;border-radius:3px;z-index:20;background:linear-gradient(90deg,transparent,#1680bd,#6a55e8,transparent) no-repeat;background-size:40% 100%;animation:eflLoadBar .9s linear infinite}
@keyframes eflLoadBar{from{background-position:-40% 0}to{background-position:140% 0}}
.efl-skel{display:grid;gap:10px;padding:6px 0}.efl-skel i{display:block;height:58px;border-radius:14px;background:linear-gradient(90deg,#eaf1f6 0%,#f7fafc 50%,#eaf1f6 100%);background-size:200% 100%;animation:eflSk 1.1s linear infinite}
.efl-skel i:nth-child(2){height:120px}
@keyframes eflSk{to{background-position:-200% 0}}
