/* Telefon görünümü (≤ 760px). app.css'ten SONRA yüklenir; yalnız dar ekranı düzenler.
   Amaç: üst çubuk az yer kaplasın, kartlar/tablolar ekrandan taşmasın, detay pencereleri tam ekran açılsın. */
@media (max-width: 760px) {
  /* ---- Üst çubuk: iki kısa satır (düğmeler + firma) ---- */
  .main > header { gap: 6px; padding: 6px 8px; min-height: 0; }
  .main > header .hide-btn,
  .main > header .btn-cache,
  .main > header .btn-primary,
  .main > header .full-btn {
    min-height: 34px; padding: 6px 10px; font-size: 12.5px; border-radius: 8px;
  }
  .main > header .btn-text { min-height: 34px; padding: 4px 6px; font-size: 12.5px; }
  .main > header .last-cache { display: none; }
  .header-firm { order: 5; flex: 1 1 100%; min-width: 0; }
  .header-firm.firm-pick .combo-btn {
    grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px;
    min-height: 38px; padding: 6px 30px 6px 10px; font-size: 14px;
  }
  .header-firm.firm-pick .combo-btn::after { right: 12px; }
  .header-firm.firm-pick .fv-donem { font-size: 12px; }

  /* ---- Sekmeler ve içerik alanı ---- */
  #tabs { padding: 4px 6px 0; }
  .tab, #tabs .tab { min-height: 36px; padding: 8px 12px; font-size: 13px; }
  #content { margin: 4px; padding: 6px; }

  /* ---- Panolar ---- */
  .ggd.cdash.cdash-ui { padding: 8px; }
  .ggd.cdash .sdash-head h2 { font-size: 1.15rem; }
  .ggd.cdash .sdash-head .lead { font-size: 12.5px; }
  .ggd-filters { flex-wrap: wrap; gap: 8px; }
  .cdash-kpis, .cdash-kpis-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
  .cdash-kpi { padding: 10px 11px; min-height: 0; }
  .cdash-kpi span { font-size: 11px; }
  .cdash-kpi strong { font-size: 17px; line-height: 1.2; word-break: break-word; }
  .cdash-kpi small { font-size: 10.5px; }
  .cdash-mix, .pf-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 10px; }
  .cek-card, .cdash-paper { max-width: 100%; min-width: 0; }
  .cdash-tbl-head { flex-wrap: wrap; gap: 4px 8px; padding: 10px 12px; }
  .cdash-tbl-head .ts-bar { margin: 0; width: 100%; }
  body .ts-q { width: auto; flex: 1 1 auto; font-size: 16px; } /* iOS odak yakınlaştırmasını önler */
  /* Tablolar: hücreler kelime kelime kırılmasın; tablo kartın içinde yana kaysın */
  .cek-card table, .cdash-paper table { min-width: 100%; }
  .cdash-table th, .cdash-table td, .cek-table th, .cek-table td { white-space: nowrap; }
  .cdash-table td:first-child, .cek-table td:first-child {
    max-width: 58vw; overflow: hidden; text-overflow: ellipsis;
  }
  .cek-card > div, .pf-scroll, .cdash-stock-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cdash-chart svg { max-width: 100%; height: auto; }

  /* Dilimleyiciler: iki sütun, açılır liste ekran içinde */
  .dsl { width: calc(50% - 6px); flex: 1 1 calc(50% - 6px); }
  .dsl-pop { position: fixed; left: 8px !important; right: 8px; top: auto; bottom: 8px; width: auto; max-width: none; max-height: 70dvh; }
  .dsl-list { max-height: 45dvh; }
  body .dsl-q { font-size: 16px; }

  /* ---- Yönetim Paneli ---- */
  .ceo-secs { grid-template-columns: minmax(0, 1fr) !important; gap: 8px !important; }
  .ceo-sec .cdash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .ceo-sec .cdash-kpi { cursor: pointer; }
  .ceo-tools > span { display: none; }
  .ceo-tscroll { max-height: 60dvh; }

  /* ---- Detay pencereleri: tam ekran ---- */
  .sdash-modal { padding: 0; align-items: stretch; }
  .sdash-modal-card, .cdash-detail-card, .cdash-modal {
    width: 100vw !important; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0;
  }
  .cdash-detail-head { flex-direction: column; gap: 8px; padding: 10px 12px 8px; }
  .cdash-detail-head h3 { font-size: 1.05rem; line-height: 1.25; word-break: break-word; }
  .cdash-detail-actions { width: 100%; }
  .cdash-detail-actions button { flex: 1 1 0; padding: 8px 6px; }
  .cdash-detail-actions [data-full], .cdash-detail-actions button:first-child:not(.is-close):not([data-export]) { display: none; }
  .cdash-detail-toolbar { flex-wrap: wrap; gap: 6px; padding: 6px 12px 8px; }
  .cdash-detail-q { flex: 1 1 100%; font-size: 16px; }
  .cdash-detail-stats { margin-left: 0; font-size: 12px; }
  .cdash-detail-table th, .cdash-detail-table td { padding: 6px 9px; }

  /* ---- Veri güncelleme penceresi ---- */
  .prep-card { width: 100%; max-height: 96dvh; }
  .prep-table th:nth-child(2), .prep-table td:nth-child(2) { display: none; }

  /* ---- Yönetim (admin) sayfası ---- */
  .admin-head .btn-cache, .admin-head .btn-ghost { padding: 6px 10px; font-size: 12.5px; }
  .admin-card { overflow-x: auto; }
  .wh-row label { font-size: 13px; }
  .wh-row input[type="time"] { font-size: 16px; }
}
@media (max-width: 380px) {
  .cdash-kpis, .cdash-kpis-3, .ceo-sec .cdash-kpis { grid-template-columns: minmax(0, 1fr) !important; }
  .dsl { width: 100%; flex-basis: 100%; }
}
