/* ═══════════════════════════════════════════════════════════
   OgrBts Mobile v4 — Tüm 62 Modülü Kapsayan Mobil Stil
   Hedef sınıflar: form-control, form-group, form-label, frow,
   btn, btn-sm, row-inline, fs-sm, font-mono, vs.
   ═══════════════════════════════════════════════════════════ */

* { -webkit-tap-highlight-color: rgba(37, 99, 235, 0.15); }

/* iOS Safe Area */
@supports (padding: max(0px)) {
  body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

/* ═══════════════════════════════════════════════════════════
   TABLET (≤1024px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .container, main, .content-wrap {
    padding: 14px !important;
    max-width: 100% !important;
  }
  
  /* form-row: 50% kolonları full yap */
  .row-inline, .form-row { gap: 10px !important; }
}

/* ═══════════════════════════════════════════════════════════
   MOBİL (≤899px) — header breakpoint ile uyumlu
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 899px) {

  /* ═══ MODAL'LAR (Mobil) - Düzeltilmiş ═══ */
  /* Modal backdrop - tam ekran arka plan */
  .modal-backdrop,
  .bg-overlay {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
  }
  
  /* Modal kutusu - tam ekran, flex yapısı korunuyor */
  .modal-backdrop > .modal,
  .modal-backdrop .modal {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Modal header - sticky üst */
  .modal-header,
  .modal-title-bar {
    flex-shrink: 0 !important;
    border-radius: 0 !important;
  }
  
  /* Modal body - SCROLL OLAN ASIL İÇERİK */
  .modal-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 12px !important;
    min-height: 0 !important;
  }
  
  /* Modal footer - sticky alt */
  .modal-footer {
    flex-shrink: 0 !important;
  }
  
  /* SweetAlert dokunma - kendi optimal mobile'ı var */
  .swal2-popup, .swal2-modal, .swal2-container { 
    height: auto !important; 
    max-height: 90vh !important; 
  }
  
  /* ═══ SEKMELER (Öğrenci Bilgi Formu gibi) ═══ */
  .sekme-btn {
    flex-shrink: 0 !important;
    font-size: 12px !important;
    padding: 8px 10px !important;
    white-space: nowrap !important;
  }
  
  /* Sekme butonları wrap yerine yatay scroll */
  .sekme-btn + .sekme-btn,
  div:has(> .sekme-btn) {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
  }
  
  /* Form section padding küçültme */
  .form-section {
    padding: 10px !important;
  }
  
  .form-section-title {
    font-size: 11px !important;
  }
  
  /* form-row mobilde tek kolon */
  .form-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  
  /* Span 2 olan alanlar full genişlik */
  .form-group[style*="grid-column"] {
    grid-column: 1 !important;
  }

  
  body { 
    font-size: 14.5px !important;
    overflow-x: auto !important;
  }
  
  /* ───── KAPSAYICILAR ───── */
  .container, main, .content-wrap, .module-container, .page-container {
    padding: 10px !important;
    margin: 0 !important;
    max-width: 100% !important;
  }
  
  /* ───── KARTLAR (Bootstrap & custom) ───── */
  .card, .panel, .box, .module-card, .frm-card, .data-card {
    width: 100% !important;
    margin: 0 0 12px 0 !important;
    border-radius: 10px !important;
    padding: 14px !important;
    box-sizing: border-box;
  }
  
  .card-header, .panel-header {
    padding: 12px 14px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
  }
  
  /* ═══ FORM-GROUP (Bootstrap) ═══ */
  .form-group {
    margin-bottom: 14px !important;
    width: 100% !important;
  }
  
  .form-group .form-label,
  .form-group label {
    display: block !important;
    margin-bottom: 6px !important;
    font-weight: 700 !important;
    font-size: 13.5px !important;
    color: #1e293b !important;
  }
  
  /* ═══ FROW (Özel rowlar) ═══ */
  .frow {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    margin-bottom: 14px !important;
    width: 100% !important;
  }
  
  .frow > label {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 0 4px 0 !important;
    font-weight: 700 !important;
    font-size: 13.5px !important;
    color: #1e293b !important;
  }
  
  .frow > input,
  .frow > select,
  .frow > textarea,
  .frow > div {
    width: 100% !important;
    flex: 1 1 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
  
  /* ═══ ROW-INLINE (yan yana inputlar) ═══ */
  .row-inline {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
  }
  
  .row-inline > * {
    width: 100% !important;
    flex: 1 1 100% !important;
  }
  
  /* Sadece çok kısa inputları yan yana tut (saat, dakika gibi) */
  .row-inline.keep-row {
    flex-direction: row !important;
  }
  
  /* ═══ FORM-ROW ═══ */
  .form-row {
    flex-direction: column !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
  }
  
  .form-row > .col,
  .form-row > [class*="col-"] {
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
  
  /* ═══ FORM-CONTROL (input/select/textarea) ═══ */
  .form-control,
  input[type="text"],
  input[type="number"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  input[type="time"],
  input[type="password"],
  input[type="search"],
  textarea,
  select {
    font-size: 16px !important;  /* iOS zoom önle */
    min-height: 44px !important;
    padding: 10px 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
    font-weight: 500 !important;
    color: #0f172a !important;
  }
  
  textarea {
    min-height: 80px !important;
    line-height: 1.5 !important;
  }
  
  select {
    -webkit-appearance: menulist !important;
    appearance: menulist !important;
  }
  
  /* ═══ BUTONLAR (tüm türler) ═══ */
  .btn,
  button,
  input[type="submit"],
  input[type="button"] {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 10px 16px !important;
    font-size: 14.5px !important;
    font-weight: 700 !important;
    touch-action: manipulation !important;
    border-radius: 8px !important;
    line-height: 1.3 !important;
  }
  
  /* btn-sm (75 yer var) — yine de dokunmatik olmalı */
  .btn-sm,
  button.small,
  .btn.small {
    min-height: 38px !important;
    min-width: 38px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
  }
  
  /* btn-gray, btn-primary vs. değişmiyor sadece boyut/font ayar */
  
  /* ═══ TABLOLAR ═══ */
  table {
    font-size: 13px !important;
    width: 100% !important;
  }
  
  table th {
    font-size: 11.5px !important;
    padding: 8px 6px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    background: #f1f5f9 !important;
    color: #0f172a !important;
    white-space: nowrap !important;
  }
  
  table td {
    padding: 10px 8px !important;
    font-size: 13px !important;
    color: #1e293b !important;
  }
  
  /* Tablo içindeki butonlar */
  table .btn, table button {
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
  }
  
  /* Tablo wrap'ı yatay scroll yap */
  .table-responsive,
  .table-wrap,
  .tablo-wrap,
  .tbl-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 0 -10px !important;
    padding: 0 10px !important;
  }
  
  /* ═══ KART TABLOSU (özel sınıf .table-cards) ═══ */
  .table-cards { display: block !important; }
  .table-cards thead { display: none !important; }
  .table-cards tbody, .table-cards tr {
    display: block !important; width: 100% !important;
  }
  .table-cards tr {
    background: white !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 10px !important;
    margin-bottom: 10px !important;
    padding: 12px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,.06) !important;
  }
  .table-cards td {
    display: flex !important;
    justify-content: space-between !important;
    padding: 6px 0 !important;
    border: none !important;
    text-align: left !important;
    white-space: normal !important;
    align-items: center;
  }
  .table-cards td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #64748b;
    flex: 0 0 40%;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  
  /* ═══ MODALLAR — Tam ekran ═══ */
  
  
  .modal-content, .modal-body {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 14px !important;
  }
  
  .modal-header, .modal-title-bar {
    padding: 14px !important;
    border-radius: 0 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background: inherit;
  }
  
  .modal-footer {
    position: sticky;
    bottom: 0;
    background: white;
    padding: 12px !important;
    border-top: 1px solid #e2e8f0;
  }
  
  /* Bg overlay (51 yer) */
  .bg-overlay {
    background: rgba(0,0,0,.6) !important;
  }
  
  /* Close button (51 yer) */
  .close-btn {
    width: 40px !important;
    height: 40px !important;
    font-size: 18px !important;
  }
  
  /* ═══ FILTRELER & TOOLBARLAR ═══ */
  .filter-bar,
  .filtre-cubugu,
  .toolbar,
  .arama-cubugu {
    flex-direction: column !important;
    gap: 8px !important;
    padding: 10px !important;
    align-items: stretch !important;
  }
  
  .filter-bar > *,
  .filtre-cubugu > *,
  .toolbar > * {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto !important;
  }
  
  /* Filtre içinde inline (örn: Tarih + Listele) yan yana tut */
  .filter-inline {
    flex-direction: row !important;
    gap: 8px !important;
  }
  
  /* ═══ DROPDOWN/SELECT ÖZEL ═══ */
  select.form-control,
  .form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    padding-right: 36px !important;
  }
  
  /* ═══ BAŞLIKLAR ═══ */
  h1, .page-title { font-size: 22px !important; }
  h2, .module-title { font-size: 19px !important; }
  h3 { font-size: 16px !important; }
  
  /* ═══ KÜÇÜK YAZILAR (fs-sm) ═══ */
  .fs-sm { font-size: 12.5px !important; }
  .font-mono { font-size: 13px !important; }
  
  /* ═══ MUTED METİNLER ═══ */
  .text-muted { font-size: 12.5px !important; color: #64748b !important; }
  
  /* ═══ BADGE/PILL ═══ */
  .badge, .pill, .chip {
    font-size: 11.5px !important;
    padding: 4px 8px !important;
    font-weight: 700 !important;
  }
  
  /* ═══ İKONLAR (Font Awesome) ═══ */
  .fa-solid, .fa, .fas {
    font-size: 0.95em !important; /* Mobilde biraz küçült */
  }
  
  /* Tek başına ikon butonlar (Düzenle, Sil gibi) */
  .btn .fa-solid:only-child,
  button .fa-solid:only-child {
    font-size: 1.1em !important;
  }
  
  /* ═══ TBL/RT-ROW ÖZEL ═══ */
  .rt-row, .pb-row {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  
  /* ═══ SBT-EMPTY (boş durumlar) ═══ */
  .sbt-empty {
    padding: 30px 14px !important;
    text-align: center;
    font-size: 13.5px;
  }
  
  /* ═══ TWH (TextWithHeader) ═══ */
  .twh {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  
  /* ═══ PAGINATION ═══ */
  .pagination {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 4px !important;
  }
  
  .pagination .page-link, .pagination a {
    min-width: 36px !important;
    min-height: 36px !important;
    padding: 6px 10px !important;
    font-size: 13px !important;
  }
  
  /* ═══ ÖZEL: SERVİS ZAMAN ÇİZELGESİ ═══ */
  /* Yatay grid çok geniş → scroll edilebilir */
  .servis-grid-wrap, .timeline-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  /* ═══ ÖZEL: ÖĞRENCI 8'LI KUTUCUK ═══ */
  .ogr-8li-wrap, .kutucuk-wrap {
    overflow-x: auto !important;
  }
  
  /* ═══ ÖZEL: ÖĞRENCI BİLGİ FORMU SEKMELERİ ═══ */
  .tab-buttons, .tabs, .nav-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin: 0 -10px !important;
    padding: 0 10px !important;
    scrollbar-width: none;
  }
  
  .tab-buttons::-webkit-scrollbar,
  .tabs::-webkit-scrollbar {
    display: none;
  }
  
  .tab-buttons > .tab-btn,
  .tabs > .tab,
  .nav-tabs > .nav-link {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 13px !important;
    padding: 10px 14px !important;
  }
  
  /* ═══ FORM-SECTION-TITLE ═══ */
  .form-section-title {
    font-size: 14px !important;
    font-weight: 800 !important;
    padding: 10px 0 6px !important;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 12px !important;
  }
  
  /* ═══ HATA / UYARI ═══ */
  .alert, .uyari, .error-msg, .success-msg {
    padding: 10px 12px !important;
    font-size: 13.5px !important;
    border-radius: 8px !important;
    margin-bottom: 10px !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   FLOATING ACTION BUTTON (Sağ alt + butonu)
   Sadece liste sayfalarında otomatik
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 899px) {
  .fab-add, .fab-new {
    position: fixed !important;
    bottom: 20px !important;
    right: 20px !important;
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 6px 20px rgba(37,99,235,.5) !important;
    font-size: 24px !important;
    z-index: 999 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.15s !important;
  }
  
  .fab-add:active {
    transform: scale(0.92) !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   KÜÇÜK MOBİL (≤480px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  body { font-size: 14px !important; }
  
  .container, main { padding: 8px !important; }
  
  h1 { font-size: 20px !important; }
  h2 { font-size: 17px !important; }
  
  /* Çok küçük ekranda padding daha az */
  .card, .panel { padding: 10px !important; }
  
  /* Modal padding küçük ekranda daha az */
  .modal-content { padding: 10px !important; }
  
  /* Tablo otomatik kart yap */
  table:not(.no-card-mobile) thead { display: none; }
  
  table:not(.no-card-mobile) {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  table:not(.no-card-mobile) tbody {
    display: block !important;
    width: 100% !important;
  }
  
  table:not(.no-card-mobile) tbody tr {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 8px;
    padding: 12px;
  }
  
  table:not(.no-card-mobile) tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 6px 0;
    border: none;
    border-bottom: 1px solid #f4f6f8;
    white-space: normal;
    text-align: right;
  }
  table:not(.no-card-mobile) tbody td:last-child { border-bottom: none; }
  table:not(.no-card-mobile) tbody td > span,
  table:not(.no-card-mobile) tbody td > * { min-width: 0; word-break: break-word; }
  
  table:not(.no-card-mobile) tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    margin-right: 8px;
    flex-shrink: 0;
    text-align: left;
  }
}

/* ═══════════════════════════════════════════════════════════
   PWA STANDALONE
   ═══════════════════════════════════════════════════════════ */
@media (display-mode: standalone) {
  body {
    padding-top: calc(64px + env(safe-area-inset-top)) !important;
  }
  
  .topnav {
    padding-top: env(safe-area-inset-top) !important;
    height: calc(64px + env(safe-area-inset-top)) !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   LANDSCAPE TELEFON (yatay)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 899px) and (orientation: landscape) {
  body { padding-top: 56px !important; }
  .topnav { height: 56px !important; }
  
  /* Yatay modda modal padding az */
  .modal-content { padding: 10px !important; }
}

/* ═══════════════════════════════════════════════════════════
   YAZDIRMA
   ═══════════════════════════════════════════════════════════ */
@media print {
  .topnav, .topnav-hamburger, .mobile-overlay,
  .fab-add, .no-print, .btn, button {
    display: none !important;
  }
  body { padding-top: 0 !important; }
}


/* ═══════════════════════════════════════════════════════════
   MODAL SCROLL FIX - Öğrenci Bilgi Formu vs.
   En son geliyor ki diğer kuralları geçersiz kılsın
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 899px) {
  
  /* MODAL BODY mutlaka scroll'lu ve flex:1 olmalı */
  .modal-body {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 12px !important;
    /* Alt boşluk - klavye veya footer için */
    padding-bottom: 80px !important;
  }
  
  /* Modal wrapper - flex container */
  .modal-backdrop > .modal,
  .modal-backdrop .modal,
  #ogrModal > .modal {
    display: flex !important;
    flex-direction: column !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow: hidden !important;
  }
  
  /* Header - sabit üstte */
  .modal-header {
    flex: 0 0 auto !important;
    border-radius: 0 !important;
  }
  
  /* Footer - sabit altta */
  .modal-footer {
    flex: 0 0 auto !important;
  }
  
  /* Body içindeki her şey doğal akmalı */
  .modal-body > * {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
  
  /* ═══ SEKMELERİ YATAY SCROLL YAP (wrap değil) ═══ */
  /* Sekmelerin parent'ı bul - genelde flex/grid container */
  .modal-body > div:has(> .sekme-btn) {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: thin !important;
    gap: 4px !important;
    padding: 4px 0 !important;
    margin-bottom: 12px !important;
  }
  
  /* Sekme butonları - sıkışmasın */
  .sekme-btn {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
    font-size: 12px !important;
    padding: 8px 12px !important;
  }
  
  /* Sekme paneller */
  .sekme-panel {
    padding: 8px !important;
  }
  
  /* Sekme container'ı için backup yöntem (has() desteklemeyen tarayıcılar) */
  .modal-body [class*="sekme"]:not(.sekme-panel) {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
  }
}

/* ═══ SAYFA BODY OVERFLOW - modal açıkken ═══ */
@media (max-width: 899px) {
  /* Modal açıkken sayfa body scroll'u kilitle (modal kendi scroll yapsın) */
  body:has(.modal-backdrop[style*="display: flex"]),
  body:has(.modal-backdrop.active),
  body:has(#ogrModal[style*="display: flex"]) {
    overflow: hidden !important;
  }
}


/* ═══════════════════════════════════════════════════════════
   ULTIMATE MODAL-BODY FIX
   flex:1 1 0% sorunu - height 32px olarak hesaplanıyor
   Çözüm: flex-basis: auto + min-height: 0 + height: auto
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 899px) {
  
  #ogrModal .modal-body,
  .modal-backdrop .modal-body,
  .modal-body {
    flex: 1 1 auto !important;        /* basis: auto önemli */
    height: auto !important;
    min-height: 200px !important;     /* En az 200px yer */
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 12px !important;
    padding-bottom: 80px !important;
    box-sizing: border-box !important;
  }
  
  /* Modal kendisini de düzelt - body'ye yer açsın */
  #ogrModal .modal,
  .modal-backdrop > .modal {
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  
  /* Header ve diğer üstte sabit elemanlar küçülsün */
  #ogrModal .modal-header {
    flex: 0 0 auto !important;
    padding: 10px 14px !important;
  }
  
  /* Modal içindeki arama/filtre alanları sabit - body değil */
  #ogrModal .modal > div:not(.modal-body):not(.modal-header):not(.modal-footer) {
    flex: 0 0 auto !important;
  }
  
  /* Footer butonları sticky alt */
  #ogrModal .modal-footer,
  #ogrModal .modal > div:last-child {
    flex: 0 0 auto !important;
  }
}


/* ═══ DRAWER İÇİNDE BÜYÜK ÇIKIŞ BUTONU ═══ */
@media (max-width: 899px) {
  .drawer-logout {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #fff !important;
    font-weight: 800 !important;
    padding: 14px 16px !important;
    border-radius: 10px !important;
    margin: 20px 16px 30px 16px !important;
    text-align: center !important;
    font-size: 15px !important;
    box-shadow: 0 4px 12px rgba(239,68,68,0.3) !important;
  }
  .drawer-logout:hover, .drawer-logout:active {
    background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
    transform: translateY(-1px) !important;
  }
  .drawer-logout i {
    margin-right: 8px !important;
  }
}

/* Desktop'ta drawer'daki çıkış butonu gizli (header'da zaten var) */
@media (min-width: 900px) {
  .drawer-logout {
    display: none !important;
  }
}

/* Mobilde tablo-wrap kaydirmasini kapat (kart modu) */
@media (max-width: 899px) {
  .table-wrap {
    overflow-x: visible !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  #ogrTable, .data-table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
  }
}

/* Personel filtre mobilde alt alta (tasma duzeltme) */
@media (max-width: 899px) {
  .pl-filter {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .pl-filter .col:last-child {
    grid-column: 1 / -1 !important;
  }
  .pl-filter input, .pl-filter select {
    font-size: 16px !important;
    padding: 8px !important;
  }
  .pl-filter .col label {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* === GENEL: tum filtre/toolbar satirlari mobilde sarmalanir (tasma engelle) === */
@media (max-width: 899px) {
  .yk-filter, .pl-filter, .bst-toolbar, .gst-toolbar,
  [class$="-filter"], [class$="-toolbar"], [class$="-filtre"] {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: stretch !important;
  }
  /* Filtre icindeki sabit genislikleri kaldir */
  .yk-filter input, .yk-filter select,
  .pl-filter input, .pl-filter select,
  .bst-toolbar input, .bst-toolbar select,
  [class$="-filter"] input, [class$="-filter"] select,
  [class$="-toolbar"] input, [class$="-toolbar"] select {
    width: auto !important;
    min-width: 0 !important;
    flex: 1 1 130px !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
  }
  /* Filtre butonlari tam genislik, alt satira gecsin */
  .yk-filter button, .pl-filter button, .bst-toolbar button,
  [class$="-filter"] button, [class$="-toolbar"] button {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
  /* Etiketler tam satir (ust ust binmesin) */
  .yk-filter label, .pl-filter label, .bst-toolbar label {
    flex: 1 1 100% !important;
    margin-bottom: -4px !important;
  }
}

/* === Servis hareketleri modal mobilde === */
@media (max-width: 899px) {
  .shr-form {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .shr-form .frow {
    grid-template-columns: 1fr !important;
    gap: 3px !important;
  }
  .shr-form .frow label {
    font-size: .78rem !important;
    font-weight: 600 !important;
    color: #475569 !important;
  }
  .shr-form .frow input,
  .shr-form .frow select {
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 16px !important;
  }
  .shr-form .kategori-row {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }
  .shr-form .time-row {
    flex-wrap: wrap !important;
  }
  /* Gidilecek yer + harita butonu alt alta */
  .shr-form .frow > div[style*="flex"] {
    flex-wrap: wrap !important;
  }
  .shr-form .btns {
    grid-column: span 1 !important;
    flex-direction: column !important;
  }
  .shr-form .btns button { width: 100% !important; }
  /* Aranan satiri (listbar) sarmalanir */
  .shr-listbar {
    flex-wrap: wrap !important;
  }
  .shr-listbar input,
  .shr-listbar select {
    flex: 1 1 130px !important;
    min-width: 0 !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
  }
}

/* === Servis modal: gidilecek yer + alt liste duzeltme === */
@media (max-width: 899px) {
  /* Gidilecek yer: input + harita butonu alt alta */
  .shr-form .frow > div[style*="display:flex"] {
    flex-wrap: wrap !important;
  }
  .shr-form .frow > div[style*="display:flex"] input {
    flex: 1 1 100% !important;
    width: 100% !important;
  }
  .shr-form .frow > div[style*="display:flex"] button {
    flex: 1 1 100% !important;
    width: 100% !important;
    justify-content: center !important;
  }
  /* Alt liste tablosu: yatay kaydirilabilir (cok kolonlu, kart olmaz) */
  .shr-tablewrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .shr-table {
    min-width: 600px !important;
  }
  /* Bu tablo kart sistemine girmesin */
  .shr-table thead { display: table-header-group !important; }
  .shr-table tr { display: table-row !important; }
  .shr-table td, .shr-table th { display: table-cell !important; }
  .shr-table td::before { display: none !important; }
}


/* ══ OGRENCI FORMU MOBIL: tum grid'ler tek sutun (inline style'lari ezer) ══ */
@media (max-width: 1024px) {
  #ogrModal .ogr-grid {
    display: block !important;
    grid-template-columns: 1fr !important;
    max-width: 100% !important;
    width: 100% !important;
    gap: 0 !important;
  }
  #ogrModal .ogr-grid > * {
    max-width: 100% !important;
    width: 100% !important;
    margin-bottom: 4px !important;
  }
  #ogrModal .form-group {
    max-width: 100% !important;
  }
  /* SEKMELER: yatay kaydirilabilir serit */
  #ogrModal .msekme-tabs,
  #ogrModal .modal-header + div,
  #ogrModal div:has(> .msekme-btn) {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 4px !important;
    padding: 6px 8px !important;
    white-space: nowrap !important;
  }
  #ogrModal .msekme-btn {
    flex: 0 0 auto !important;
    font-size: 0.78rem !important;
    padding: 7px 12px !important;
  }
  #ogrModal .modal,
  #ogrModal .modal-body {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }
  #ogrModal input,
  #ogrModal select,
  #ogrModal textarea {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}
