.mobile-nav-control{display:none}
@media(max-width:900px){
  #app-screen{padding-left:0!important}
  #app-screen>.topbar{position:relative;height:auto;min-height:52px;padding:10px 12px;gap:8px;flex-wrap:wrap;background:#050c1a;color:#fff;border-bottom:2px solid #1ab8ff}
  #app-screen>.topbar .topbar-logo{font-size:16px;color:#fff}
  #app-screen>.topbar .topbar-logo small{display:none}
  #app-screen>.topbar .topbar-right{flex-wrap:wrap;margin-left:0}
  #app-screen>.topbar .topbar-user,#app-screen>.topbar .role-badge,#app-screen>.topbar .btn-logout{color:#fff}
  .mobile-nav-control{display:block;min-height:44px;border:1px solid #1ab8ff;border-radius:6px;background:#0d2137;color:#fff;padding:8px 12px;font:700 16px Arial,sans-serif;cursor:pointer}
  #app-screen>.global-search{position:sticky;top:0;z-index:210;display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px;width:100%;margin:0;padding:8px 12px;background:#071426;box-sizing:border-box;border-bottom:1px solid #1ab8ff}
  #global-section-search{width:100%;min-width:0;min-height:44px;box-sizing:border-box;font:16px Arial,sans-serif;padding:8px 10px;border:1px solid #bfd3e1;border-radius:6px;background:#fff;color:#142c3c}
  #global-search-results{display:none;grid-column:1/-1;max-height:55vh;max-height:55dvh;overflow:auto;overscroll-behavior:contain;background:#fff;border:1px solid #bfd3e1;border-radius:6px;padding:4px}
  #global-search-results.active{display:grid}
  #global-search-results a{display:flex;align-items:center;min-height:44px;padding:8px;box-sizing:border-box;font:16px Arial,sans-serif;color:#143248;text-decoration:none;overflow-wrap:anywhere}
  #global-search-results a:focus,#global-search-results a:hover{background:#eef8ff}
  #app-screen>.subnav{display:none;position:fixed;top:0;bottom:0;left:0;width:min(360px,calc(100vw - 32px));height:100vh;height:100dvh;box-sizing:border-box;z-index:230;padding:12px 12px max(16px,env(safe-area-inset-bottom));overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;background:#050c1a;color:#fff;border:0;box-shadow:4px 0 24px #0008}
  body.mobile-nav-open #app-screen>.subnav{display:block}
  body.mobile-nav-open{overflow:hidden}
  #mobile-nav-backdrop{display:none;position:fixed;inset:0;z-index:220;width:100%;height:100%;background:#142c3c66;border:0;border-radius:0}
  body.mobile-nav-open #mobile-nav-backdrop{display:block}
  #mobile-nav-close{width:100%;margin-bottom:12px}
  #app-screen>.subnav .sidebar-toggle,#app-screen>.subnav .sidebar-customize{display:none}
  #app-screen>.subnav>.tab{display:block!important;padding:0;margin:0 0 4px;white-space:normal;text-transform:none;letter-spacing:normal;border:0;border-radius:6px;color:#fff;text-shadow:none;font:700 17px Arial,sans-serif;font-size:17px!important}
  #app-screen>.subnav>a.tab,#app-screen>.subnav .tab-main-link{display:flex;align-items:center;justify-content:space-between;min-height:48px;padding:10px 12px;box-sizing:border-box;color:#fff;text-decoration:none;overflow-wrap:anywhere}
  #app-screen>.subnav .tab.active,#app-screen>.subnav .tab-main-link:focus{background:#11314d;color:#1ab8ff}
  #app-screen>.subnav .tab-menu{display:none!important;position:static!important;width:auto!important;max-height:none!important;margin:0 0 8px 12px;padding:4px;border-left:2px solid #1ab8ff;background:#0b1a2d;box-shadow:none;transform:none!important}
  #app-screen>.subnav .submenu-open>.tab-menu{display:grid!important}
  #app-screen>.subnav .tab-menu a{display:flex;align-items:center;min-height:48px;padding:10px;box-sizing:border-box;white-space:normal;color:#fff;font:16px Arial,sans-serif;text-decoration:none;overflow-wrap:anywhere}
  #app-screen>.subnav .menu-item-hidden,#app-screen>.subnav .tab-menu a.menu-subitem-hidden{display:none!important}
  #app-screen>.subnav .tab-menu a:hover,#app-screen>.subnav .tab-menu a:focus{background:#11314d;color:#1ab8ff}
  #app-screen>.subnav [hidden]{display:none!important}
}
@media(max-width:700px){
  #logistics-content{width:100%;min-width:0;overflow:visible}
  #logistics-content *{min-width:0;box-sizing:border-box}
  #logistics-content .lg-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));overflow:visible;padding:5px}
  #logistics-content .lg-tabs button{width:100%;min-height:52px;padding:7px 4px;white-space:normal;line-height:1.2}
  #logistics-content .row-actions,#logistics-content .lg-routes-toolbar{display:grid;grid-template-columns:1fr;align-items:stretch;gap:8px}
  #logistics-content .row-actions button,#logistics-content .lg-routes-toolbar button,#logistics-content .lg-routes-toolbar .field{width:100%;min-width:0;min-height:46px;margin:0}
  #logistics-content .lg-request-filters{display:grid;grid-template-columns:1fr;gap:8px}
  #logistics-content .lg-request-filters .fi{width:100%;min-height:46px;font-size:16px}
  #logistics-content .lg-request-period,#logistics-content .lg-request-view,#logistics-content .lg-route-view{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  #logistics-content .lg-request-period{grid-template-columns:repeat(4,minmax(0,1fr))}
  #logistics-content .lg-request-period button,#logistics-content .lg-request-view button,#logistics-content .lg-route-view button{min-width:0;min-height:44px;padding:7px 4px;white-space:normal}
  #logistics-content .lg-request-table,#logistics-content .lg-route-table,#logistics-content .lg-vehicle-table{display:block;width:100%;min-width:0!important;border:0}
  #logistics-content .lg-request-table thead,#logistics-content .lg-route-table thead,#logistics-content .lg-vehicle-table thead{display:none}
  #logistics-content .lg-request-table tbody,#logistics-content .lg-route-table tbody,#logistics-content .lg-vehicle-table tbody{display:grid;gap:10px;width:100%;padding:8px;background:#eef3f7}
  #logistics-content .lg-request-table tr,#logistics-content .lg-route-table tr,#logistics-content .lg-vehicle-table tr{display:grid;width:100%;padding:10px;border:1px solid #d7e0ea;border-radius:9px;background:#fff;box-shadow:0 2px 7px #102a4310}
  #logistics-content .lg-request-table td,#logistics-content .lg-route-table td,#logistics-content .lg-vehicle-table td{display:block;width:100%;padding:7px 2px;border:0;border-bottom:1px solid #edf1f5;text-align:left!important;white-space:normal;overflow-wrap:anywhere}
  #logistics-content .lg-request-table td:last-child,#logistics-content .lg-route-table td:last-child,#logistics-content .lg-vehicle-table td:last-child{border-bottom:0}
  #logistics-content .lg-request-table td::before,#logistics-content .lg-route-table td::before,#logistics-content .lg-vehicle-table td::before{display:block;margin-bottom:3px;color:#617387;font-size:12px;font-weight:700}
  #logistics-content .lg-request-table td:nth-child(1)::before{content:'Заявка'}#logistics-content .lg-request-table td:nth-child(2)::before{content:'Клиент'}#logistics-content .lg-request-table td:nth-child(3)::before{content:'Статус'}#logistics-content .lg-request-table td:nth-child(4)::before{content:'Тип'}#logistics-content .lg-request-table td:nth-child(5)::before{content:'Маршрут'}#logistics-content .lg-request-table td:nth-child(6)::before{content:'План'}#logistics-content .lg-request-table td:nth-child(7)::before{content:'Груз'}#logistics-content .lg-request-table td:nth-child(8)::before{content:'Создано'}
  #logistics-content .lg-route-table td:nth-child(1)::before{content:'Рейс'}#logistics-content .lg-route-table td:nth-child(2)::before{content:'Дата'}#logistics-content .lg-route-table td:nth-child(3)::before{content:'Статус'}#logistics-content .lg-route-table td:nth-child(4)::before{content:'Водитель'}#logistics-content .lg-route-table td:nth-child(5)::before{content:'Машина'}#logistics-content .lg-route-table td:nth-child(6)::before{content:'Остановки'}#logistics-content .lg-route-table td:nth-child(7)::before{content:'Отгрузки'}#logistics-content .lg-route-table td:nth-child(8)::before{content:'Обновлено'}
  #logistics-content .lg-vehicle-table td:nth-child(1)::before{content:'Автомобиль'}#logistics-content .lg-vehicle-table td:nth-child(2)::before{content:'Тип'}#logistics-content .lg-vehicle-table td:nth-child(3)::before{content:'Водитель'}#logistics-content .lg-vehicle-table td:nth-child(4)::before{content:'Вместимость'}#logistics-content .lg-vehicle-table td:nth-child(5)::before{content:'Состояние'}#logistics-content .lg-vehicle-table td:nth-child(6)::before{content:'Обновлено'}
  #logistics-content td.empty{display:block!important;text-align:center!important}
  #logistics-content td.empty::before{content:none!important}
  #logistics-content .lg-board{display:grid;grid-template-columns:1fr;overflow:visible}
  #logistics-content .lg-endpoints{grid-template-columns:1fr}.lg-arrow{transform:rotate(90deg)}
  #logistics-content .lg-location-grid{display:grid;grid-template-columns:1fr;gap:10px}
  #logistics-content .wh-panel{width:100%;padding:10px}
  #logistics-content .lg-card-head{align-items:flex-start;flex-wrap:wrap;overflow-wrap:anywhere}
  #logistics-content .lg-card-head button{min-height:44px}
  #logistics-content .lg-card{overflow-wrap:anywhere}
  #logistics-content .lg-line{grid-template-columns:1fr 44px;gap:7px;border:1px solid #d7e0ea;border-radius:8px;padding:8px}
  #logistics-content .lg-line>*:not(.lg-line-remove){grid-column:1}
  #logistics-content .lg-line .lg-line-remove{grid-column:2;grid-row:1/4;width:44px;height:100%;min-height:44px}
  #logistics-content .lg-line-head{display:none}
  #logistics-content .lg-svc-line{grid-template-columns:minmax(0,1fr) 76px;align-items:start}
  #logistics-content .lg-svc-line-total{grid-column:1/-1;text-align:right}
  #custom-modal .modal-content{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);margin:8px;overflow:auto}
  #custom-modal .mbody{padding:12px}
  #custom-modal .mgrid2,#custom-modal .mgrid3{grid-template-columns:1fr!important}
  #custom-modal .mfooter{display:grid;grid-template-columns:1fr;gap:8px}
  #custom-modal .mfooter button{width:100%;min-height:48px}
}
