/* HAWKOPS v8.132.0 (D12 z „Kroków po audycie 04.11.2026”, makiety zaakceptowane 06.11.2026) — telefon i wąski ekran.
   Komputer (1920 px) bez zmian: poza @media tylko ukrycie nowych elementów. Ładowany ostatni (po screens.css), żeby
   wygrywał z wyglądem ekranów i modułów.
   - do 980 px: menu boczne jako szuflada (☰ w górnym pasku, MENU w dolnym pasku), dolny pasek pomostu (DASHBOARD,
     PAX POOL, DAY PLAN, CALL ME z licznikiem, MENU), baza w górnym pasku;
   - do 760 px (telefon): okna (.modal) na cały ekran z przyciskami na dole, przyciski i pola min. 44 px, tabele w
     .table-wrap jako karty (nazwa kolumny z data-label — app.js; tabela-siatka zostaje tabelą: .hawk-keep-table),
     DASHBOARD bez liczb pod tytułem i z PREVIEW na górze, wybór okresu (.hawk-seg) bez przewijania strony w bok.
   v8.133.0 — ekrany pomostu według makiet (na końcu pliku): PAX POOL (karta grupy, liczby w jednym rzędzie, kafle dni
   przesuwane palcem), filtry list pod „Filtry” (app.js), DAY PLAN (lot i grupy, ⋯ — planning.js), karta grupy (jedna
   kolumna, skróty sekcji — app.js), CALL ME („Zadzwoń”); POS — w pos.css. */
.nav-menu-btn,
.top-base,
.nav-backdrop,
.hawk-tabbar,
.nav-phone,
.fb-more,
.hawk-filters-toggle,
.gc-jump {
  display: none;
}

@media (max-width: 980px) {
  /* menu boczne — szuflada z lewej */
  .hawk-app .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    width: min(320px, 86vw);
    height: auto;
    min-height: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  .hawk-app.nav-open .sidebar {
    transform: none;
    box-shadow: 8px 0 30px rgba(15, 22, 35, 0.35);
  }
  .side-nav {
    display: block;
  }
  .nav-section {
    margin: 0 0 6px;
  }
  .side-nav .nav-item {
    min-height: 44px;
  }
  /* v8.150.0: REPORTS — napis sekcji rozwija; w szufladzie wysoki jak przycisk (palec), wygląd napisu bez zmian */
  .side-nav .nav-label-toggle {
    min-height: 44px;
    padding-bottom: 0;
  }
  /* części szuflady tylko na telefonie — nie .nav-section (menu na komputerze, uprawnienia i testy menu bez zmian) */
  .nav-phone {
    display: block;
    margin: 0 0 6px;
  }
  .drawer-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0 6px;
  }
  .drawer-shortcuts .shortcut {
    min-height: 40px;
  }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 89;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: rgba(15, 22, 35, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  .hawk-app.nav-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  /* górny pasek: ☰, baza, zegar, profil — przyklejony u góry */
  .hawk-topbar {
    position: sticky;
    top: 0;
  }
  .nav-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: var(--hawk-brand-soft);
    color: var(--hawk-brand);
  }
  .top-left-actions {
    min-width: 0;
  }
  /* dolny pasek pomostu */
  .hawk-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom);
    background: #fff;
    border-top: 1px solid #e1e5ea;
    box-shadow: 0 -4px 16px rgba(20, 30, 50, 0.06);
  }
  .hawk-tabbar > button {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #5f6877;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }
  .hawk-tabbar > button.active {
    color: var(--hawk-brand);
    box-shadow: inset 0 3px 0 var(--hawk-gold);
  }
  .hawk-tabbar svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .hawk-tabbar .tab-icon {
    position: relative;
    display: flex;
  }
  .hawk-tabbar .tab-badge {
    position: absolute;
    top: -5px;
    right: -10px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    box-sizing: border-box;
    border-radius: 8px;
    background: #b42318;
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
  }
  .content-shell {
    padding-bottom: 72px;
  }
}

@media (max-width: 760px) {
  /* górny pasek telefonu: ☰, baza, zegar (bez daty i strefy), profil; ulubione i moduły — w szufladzie */
  .hawk-topbar {
    height: 56px;
    padding: 0 10px;
    gap: 8px;
  }
  .shortcut-bar,
  .white-top-menu,
  .top-clock .clock-date,
  .top-clock .clock-zone {
    display: none;
  }
  .top-base {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 700;
    color: var(--hawk-brand);
  }
  .top-actions {
    gap: 8px;
    flex: none;
  }

  /* przyciski i pola — min. 44 px; pola 16 px (telefon nie powiększa strony przy wpisywaniu) */
  :is(#app, .modal)
    :is(button, select, textarea, input:not([type='checkbox']):not([type='radio']):not([type='hidden'])) {
    min-height: 44px;
  }
  :is(#app, .modal) :is(select, textarea, input:not([type='checkbox']):not([type='radio'])) {
    font-size: 16px;
  }
  /* v8.181.0: pole pliku — przycisk z ikoną UPLOAD 44 × 44 px */
  :is(#app, .modal) input[type='file'] {
    width: 44px;
    min-width: 44px;
    height: 44px;
    font-size: 0;
  }
  :is(#app, .modal) input[type='file']::file-selector-button {
    width: 44px;
    height: 44px;
  }

  /* okna na cały ekran; przyciski formularza przyklejone na dole */
  .modal {
    padding: 0;
    place-items: stretch;
  }
  .modal > .modal-card {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh;
    max-height: 100dvh !important;
    border-radius: 0;
    padding: 16px 14px;
    box-sizing: border-box;
  }
  .modal > .modal-card.group-card {
    padding: 0;
  }
  /* × zamknięcia — 44 px, tytuł obok niego (nie pod nim) */
  .modal-card > .close {
    top: 6px;
    right: 6px;
    z-index: 6;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 10px;
    background: var(--hawk-brand-soft);
    color: var(--hawk-brand);
  }
  .modal-card > .close + * {
    padding-right: 50px;
  }
  .modal-card :is(h2, h3) {
    overflow-wrap: anywhere;
  }
  .modal-card .form-actions {
    position: sticky;
    bottom: -16px;
    z-index: 5;
    margin: 12px -14px -16px;
    padding: 10px 14px 14px;
    background: #fff;
    border-top: 1px solid #e1e5ea;
    flex-wrap: wrap;
  }
  .modal-card .form-actions > button {
    flex: 1 1 auto;
  }

  /* tabele jako karty: wiersz = karta, komórka = „nazwa kolumny: wartość” */
  .table-wrap:has(> table:not(.hawk-keep-table)) {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }
  .table-wrap > table:not(.hawk-keep-table) {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    border: 0;
    background: transparent;
  }
  .table-wrap > table:not(.hawk-keep-table) > thead,
  .table-wrap > table:not(.hawk-keep-table) tr.hawk-head-row,
  .table-wrap > table:not(.hawk-keep-table) > colgroup {
    display: none;
  }
  .table-wrap > table:not(.hawk-keep-table) > :is(tbody, tfoot) {
    display: block;
  }
  .table-wrap > table:not(.hawk-keep-table) > :is(tbody, tfoot) > tr {
    display: block;
    margin: 0 0 10px;
    padding: 4px 12px;
    border: 1px solid #e1e5ea;
    border-radius: 12px;
    background: #fff;
    box-shadow: none;
  }
  .table-wrap > table:not(.hawk-keep-table) > :is(tbody, tfoot) > tr > :is(td, th) {
    position: static;
    display: flow-root;
    width: auto !important;
    min-width: 0;
    max-width: none;
    padding: 8px 0;
    border: 0;
    border-top: 1px solid #f0f2f5;
    background: transparent;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
    box-shadow: none;
  }
  .table-wrap > table:not(.hawk-keep-table) > :is(tbody, tfoot) > tr > :is(td, th):first-child {
    border-top: 0;
  }
  /* nazwa kolumny po lewej (pływa), wartość obok po prawej — zawija się normalnie, także kilka elementów w komórce */
  .table-wrap > table:not(.hawk-keep-table) > :is(tbody, tfoot) > tr > :is(td, th)::before {
    content: attr(data-label);
    float: left;
    width: 38%;
    margin-right: 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #4a5361;
    overflow-wrap: normal;
  }
  .table-wrap
    > table:not(.hawk-keep-table)
    > :is(tbody, tfoot)
    > tr
    > :is(td, th):is([data-label=''], :not([data-label])) {
    display: block;
    text-align: left;
  }
  .table-wrap
    > table:not(.hawk-keep-table)
    > :is(tbody, tfoot)
    > tr
    > :is(td, th):is([data-label=''], :not([data-label]))::before {
    content: none;
  }
  .table-wrap > table:not(.hawk-keep-table) > :is(tbody, tfoot) > tr > :is(td, th):empty {
    display: none;
  }

  /* wybór okresu (SOLD i inne listy) — dwa rzędy zamiast przewijania strony w bok */
  .hawk-seg {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    flex: 1 1 100%;
  }
  .hawk-seg > button,
  .hawk-seg > button:first-child,
  .hawk-seg > button:last-child {
    margin: 0;
    border-radius: 9px;
    white-space: normal;
  }

  /* DASHBOARD na telefonie: bez liczb pod tytułem (uwaga użytkownika 06.11.2026), PREVIEW na górze */
  #pageDashboard .dashboard-stats {
    display: none;
  }
  .dash-live {
    display: flex;
    flex-direction: column;
  }
  .dash-live > .dash-preview {
    order: -1;
  }
}

/* ===== v8.133.0 (D12, makiety zaakceptowane 06.11.2026) — ekrany pomostu na telefonie ===== */
@media (max-width: 760px) {
  /* filtry list: wyszukiwarka i przyciski widoczne, reszta pod „Filtry · n” */
  .hawk-filters-toggle {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
  }
  .hawk-filters:not(.hawk-filters-open)
    > :not(.hawk-search):not(.hawk-filters-toggle):not(.hawk-filters-end):not(button) {
    display: none;
  }
  .hawk-filters > .hawk-search {
    flex: 1 1 160px;
    min-width: 0;
  }

  /* kafle dni (PAX POOL, DAY PLAN): przesuwane palcem; wybór daty pod nimi */
  .pax-day-bar {
    flex-direction: column;
    flex-wrap: nowrap; /* przy zawijaniu kolumna ma szerokość treści — kafle wychodziłyby poza ekran */
  }
  .pax-day-bar .plan-nearby-days {
    max-width: 100%;
    min-width: 0;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex: none;
  }
  .pax-day-bar .nearby-day {
    flex: 0 0 76px;
    min-height: 52px;
    justify-content: center;
  }
  .pax-day-bar .plan-day-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }
  .pax-day-bar .plan-day-nav input {
    flex: 1 1 120px;
    min-width: 0;
  }

  /* PAX POOL: cztery liczby w jednym rzędzie */
  #pageDemand .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  #pageDemand .stats .stat {
    padding: 6px 7px;
    min-height: 0;
  }
  #pageDemand .stats .stat span {
    font-size: 10px;
    line-height: 1.2;
  }
  #pageDemand .stats .stat b {
    font-size: 18px;
  }
  /* PAX POOL: karta grupy — klient i Safety na górze, termin, PAX / KG, status, kontakt, cena, odprawa, przyciski */
  .table-wrap > table.pax-pool-table > tbody > tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      'who safety'
      'when pax'
      'status contact'
      'price checkin'
      'eta eta'
      'acts acts';
    gap: 8px 12px;
    padding: 12px;
  }
  .table-wrap > table.pax-pool-table > tbody > tr.row-nogo {
    border-color: #f3cfcf;
    background: #fff7f7;
  }
  .table-wrap > table.pax-pool-table > tbody > tr > td {
    padding: 0;
    border: 0;
    text-align: left;
  }
  .table-wrap > table.pax-pool-table > tbody > tr > td::before {
    float: none;
    display: block;
    width: auto;
    margin: 0 0 2px;
    font-size: 11px;
  }
  .table-wrap > table.pax-pool-table > tbody > tr > td:nth-child(1) {
    grid-area: when;
  }
  .table-wrap > table.pax-pool-table > tbody > tr > td:nth-child(2) {
    grid-area: eta;
  }
  .table-wrap > table.pax-pool-table > tbody > tr > td:nth-child(3) {
    grid-area: who;
    font-size: 15px;
  }
  .table-wrap > table.pax-pool-table > tbody > tr > td:nth-child(4) {
    grid-area: pax;
  }
  .table-wrap > table.pax-pool-table > tbody > tr > td:nth-child(5) {
    grid-area: checkin;
  }
  .table-wrap > table.pax-pool-table > tbody > tr > td:nth-child(6) {
    grid-area: price;
  }
  .table-wrap > table.pax-pool-table > tbody > tr > td:nth-child(7) {
    grid-area: status;
  }
  .table-wrap > table.pax-pool-table > tbody > tr > td:nth-child(8) {
    grid-area: contact;
  }
  .table-wrap > table.pax-pool-table > tbody > tr > td:nth-child(9) {
    grid-area: safety;
    text-align: right;
  }
  .table-wrap > table.pax-pool-table > tbody > tr > td:nth-child(10) {
    grid-area: acts;
  }
  .table-wrap > table.pax-pool-table > tbody > tr > td:is(:nth-child(3), :nth-child(9), :nth-child(10))::before {
    content: none;
  }
  .pax-pool-table .pax-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .pax-pool-table .pax-actions > button {
    flex: 1 1 auto;
  }

  /* DAY PLAN: liczby przesuwane palcem, przyciski w nagłówku obok siebie */
  #pagePlan .plan-stats {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }
  #pagePlan .plan-stats .stat {
    flex: 0 0 auto;
    min-width: 96px;
  }
  #pagePlan .plan-toolbar .toolbar-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  /* lot: godzina, numer, stan i obciążenie w zwartym nagłówku; grupy jako karty */
  .fb-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 12px;
  }
  .fb-groups {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .fb-group {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      'who status'
      'extra extra'
      'sold sold'
      'pos pos'
      'acts acts';
    gap: 8px 10px;
    align-items: start;
  }
  .fb-g-who {
    grid-area: who;
  }
  .fb-g-status {
    grid-area: status;
    justify-items: end;
    text-align: right;
  }
  .fb-g-extra {
    grid-area: extra;
  }
  .fb-g-sold {
    grid-area: sold;
  }
  .fb-g-pos {
    grid-area: pos;
  }
  .fb-g-actions {
    grid-area: acts;
  }
  .fb-group > :empty {
    display: none;
  }
  .fb-g-pos .pos-entry {
    width: 100%;
    min-height: 48px;
    font-size: 15px;
  }
  /* przy grupie: Edytuj i ⋯ (reszta — po ⋯); przy locie: LISTA PAX, Historia i ⋯ */
  .fb-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: 10; /* ⋯ przy locie jest pierwsze w HTML — na telefonie na końcu */
    font-size: 20px;
  }
  .fb-g-actions,
  .flight-bar > .fb-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px;
  }
  .fb-g-actions > button,
  .flight-bar > .fb-actions > button {
    width: 100%;
  }
  .fb-group:not(.fb-more-open) .fb-g-actions > :not([data-open-request]):not(.fb-more),
  .flight-bar:not(.fb-more-open) > .fb-actions > :not([data-paxlist-open]):not(.history-btn):not(.fb-more) {
    display: none;
  }
  .fb-group:not(.fb-more-open) .fb-g-actions {
    grid-template-columns: minmax(0, 1fr) 52px;
  }
  .flight-bar:not(.fb-more-open) > .fb-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 52px;
  }

  /* karta grupy: jedna kolumna, skróty do sekcji pod nagłówkiem */
  .group-card .gc-grid,
  .group-card .gc-section.gc-wide .gc-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .group-card .gc-grid > * {
    grid-column: 1 / -1;
  }
  .group-card-head {
    flex-wrap: wrap;
  }
  .group-card-head > div:first-child {
    flex: 1 1 0;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .gc-jump {
    display: flex;
    flex: 1 1 100%;
    gap: 6px;
    overflow-x: auto;
    padding-top: 6px;
  }
  .gc-jump > button {
    flex: 0 0 auto;
    padding: 0 12px;
    border-radius: 999px;
    background: #fff;
    color: var(--hawk-brand);
    box-shadow: inset 0 0 0 1px #ddd0e8;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
  }
  .gc-jump > button.active {
    background: var(--hawk-brand);
    color: #fff;
  }

  /* CALL ME: duży przycisk „Zadzwoń”, wyniki rozmowy w dwóch kolumnach */
  .call-person,
  .callback-reminder {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  :is(.call-person, .callback-reminder) a.call-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    margin-top: 8px;
    border-radius: 12px;
    background: #1a6b3c;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    text-decoration: none;
  }
  :is(.call-person, .callback-reminder) a.call-phone::before {
    content: 'Zadzwoń ';
    white-space: pre;
  }
  :is(.call-person, .callback-reminder) .row-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  :is(.call-person, .callback-reminder) .row-actions > button {
    min-height: 48px;
  }
}
