/* ===== Телефон: удобная админка ===== */
#bnav, #sideShade, .m-ftoggle { display: none; }
@media (max-width: 760px) {
  html, body { -webkit-text-size-adjust: 100%; }
  input.in, select.sel, textarea, .in, .sel { font-size: 16px !important; }   /* iPhone не увеличивает страницу при вводе */
  .top { height: 54px; padding: 0 8px; gap: 8px; }
  .top-clock { font-size: 12px; line-height: 1.2; max-width: 90px; }
  .top .user > button { padding: 3px; }
  .top .user > button > span:not(.av) { display: none; }
  .main { padding: 12px 10px 92px; }
  .page-head { gap: 8px; margin-bottom: 12px; }
  .page-head h1 { font-size: 21px; width: 100%; }
  .page-head .grow { display: none; }
  .page-head .btn { flex: 1 1 auto; justify-content: center; }
  .page-head input[type=date] { flex: 1 1 140px; width: auto !important; }

  /* меню слева — поверх, с затемнением */
  .side { width: 84vw !important; max-width: 320px; z-index: 70; padding: 16px 12px 90px; }
  .side.collapsed { width: 0 !important; padding: 0; }
  #sideShade { display: block; position: fixed; inset: 0; background: rgba(10, 18, 38, .45); z-index: 65; }
  #sideShade.hidden { display: none; }
  .side .grp > a { padding: 12px; font-size: 15px; }
  .side .sub a { padding: 10px; font-size: 14px; }

  /* вкладки — листаются пальцем, не переносятся */
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { white-space: nowrap; flex: none; }
  .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .seg button { white-space: nowrap; flex: none; }

  /* фильтры — по одному в строку, прячутся под кнопку */
  .filters { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px; }
  .filters > * { width: 100% !important; min-width: 0; flex: none !important; }
  .filters.m-hide { display: none !important; }
  .m-ftoggle { display: flex; width: 100%; justify-content: center; margin-bottom: 10px; }

  /* таблицы → карточки */
  .tbl-wrap { overflow: visible; background: transparent; border: 0; box-shadow: none; }
  table.tbl.m-cards, table.tbl.m-cards tbody, table.tbl.m-cards tr, table.tbl.m-cards td { display: block; width: 100%; }
  table.tbl.m-cards { background: transparent; border: 0; box-shadow: none; }
  table.tbl.m-cards thead { display: none; }
  table.tbl.m-cards tr { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; padding: 6px 0; box-shadow: var(--shadow); }
  table.tbl.m-cards td { display: block; padding: 5px 14px; border: 0 !important; text-align: left !important; min-height: 0; }
  table.tbl.m-cards td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 1px; }
  table.tbl.m-cards td:not([data-label])::before, table.tbl.m-cards td[data-label=""]::before { display: none; }
  table.tbl.m-cards td:empty { display: none; }
  table.tbl.m-cards td:first-child { font-size: 15px; }
  table.tbl.m-cards td.empty, table.tbl.m-cards td[colspan] { display: block; text-align: center; }
  table.tbl.m-cards td.nowrap { white-space: normal; }
  table.tbl.m-cards tr.total { background: var(--yellow-soft); }

  /* окна — на весь экран */
  .modal { padding: 0; }
  .modal-box, .modal-box.wide, .modal-box.narrow { max-width: none; border-radius: 0; min-height: 100%; }
  .modal-pad { padding: 16px 14px 90px; }
  .modal-close { position: fixed; right: 10px; top: 10px; width: 38px; height: 38px; z-index: 60; box-shadow: var(--shadow); }
  .save-bar { position: sticky; bottom: 0; z-index: 5; }

  /* карточка заказа */
  .ocols { grid-template-columns: 1fr !important; }
  .ocols > div { border-right: 0 !important; border-bottom: 1px solid var(--line); padding: 14px; }
  .osec { padding: 14px; }
  .ohead { padding: 14px 54px 14px 14px; }
  .orow { grid-template-columns: 26px 1fr 1fr 1fr !important; gap: 8px; }
  .orow > :nth-child(2) { grid-column: 2 / -1; }
  .orow > :nth-child(3) { grid-column: 2 / 3; }
  .orow > :nth-child(4) { grid-column: 3 / 4; }
  .orow > :nth-child(5) { grid-column: 4 / 5; }
  .orow > span:not(.pt) { display: none; }
  .ofoot { padding: 12px 14px 80px; }
  .ofoot .btn { flex: 1 1 45%; justify-content: center; }
  .mtabs { overflow-x: auto; white-space: nowrap; padding-right: 50px; }
  .map, #zMap { height: 62vh !important; }
  .btn { min-height: 40px; }

  /* нижняя панель */
  #bnav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: #fff; border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(16, 24, 40, .06); }
  #bnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 2px 0; }
  #bnav a .i { font-size: 20px; line-height: 24px; }
  #bnav a.on { color: var(--navy); }
  #bnav a.on .i { filter: none; }
  #bnav a.plus .i { background: var(--yellow); color: var(--navy); width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-top: -18px; box-shadow: 0 4px 12px rgba(235, 212, 57, .5); font-size: 26px; font-weight: 700; }
  body.m-modal #bnav, body.m-out #bnav { display: none; }
  table.tbl.m-cards td { overflow-wrap: anywhere; }
  table.tbl.m-cards td > * { min-width: 0; }
}
