/* Общий каркас: не меняет плотность диспетчерских таблиц. */
:root { --accent: #176b75; --accent-h: #11545d; --bg: #f3f6f8; --side: #142b36; }
.brand small { margin-top: 6px; line-height: 1.5; }
aside .grp { color: #9bb2c2; }
aside a { margin: 2px 8px; border-radius: 6px; padding: 9px 10px; }
aside a.active { background: #214853; border-left-color: #62d6cf; }
.nav-search { display: block; margin: 16px 14px 4px; font-size: 12px; color: #b8c7d9; }
.nav-search input { width: 100%; margin-top: 6px; background: #203c48; border-color: #365461; color: white; }
.nav-search input::placeholder { color: #b8c7d9; font-size: 11px; }
#nav [hidden] { display: none !important; }
.topbar { min-height: 68px; }
.panel, .card { box-shadow: 0 3px 12px #18354305; }
.login-box { width: min(440px, calc(100vw - 32px)); padding: 36px; border-top: 5px solid #48b5ad; }
#login-screen { min-height: 100dvh; height: auto; padding: 24px 0; background: radial-gradient(ellipse at top right, #24606a, #112a36 70%); }
.login-box h1 { font-size: 23px; margin-bottom: 12px; }
.login-box input { min-height: 42px; }
.login-box .btn { min-height: 44px; margin-top: 8px; }
:focus-visible { outline: 3px solid #269aab; outline-offset: 3px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.menu-toggle, .nav-close { display: none; }
@media screen and (max-width: 900px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  #app { grid-template-columns: minmax(0, 1fr); min-height: 100dvh; }
  #app > aside {
    display: none; position: fixed; z-index: 40; top: 0; bottom: 0; left: 0;
    width: min(320px, 88vw); height: 100dvh; max-height: none; overflow-y: auto;
    padding-top: env(safe-area-inset-top); box-shadow: 12px 0 32px #04101866;
  }
  #app.nav-open > aside { display: block; }
  #app.nav-open { overflow: hidden; }
  body:has(#app.nav-open) { overflow: hidden; }
  #app.nav-open::before {
    content: ""; position: fixed; inset: 0; z-index: 30; background: #07182080;
  }
  #nav { display: block; }
  .menu-toggle, .nav-close { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
  .nav-close { margin-left: auto; background: transparent; color: #d5e4ee; border: 1px solid #3d5c6b; border-radius: 8px; padding: 6px 10px; }
  aside a { min-height: 44px; display: flex; align-items: center; }
  .content { padding: 14px 12px max(28px, env(safe-area-inset-bottom)); }
  .topbar {
    padding: max(10px, env(safe-area-inset-top)) 12px 10px;
    flex-wrap: wrap; gap: 8px;
  }
  .topbar h2 { font-size: 16px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .userbox { margin-left: auto; font-size: 12px; }
  .tabs, .route-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .modal-bg { padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom)); align-items: flex-end; }
  .modal { width: 100%; max-height: calc(100dvh - 16px); overflow: auto; }
  .modal .cols, .route-document-fields { grid-template-columns: 1fr; }
  .modal .foot { flex-wrap: wrap; }
  .modal .foot .btn { flex: 1 1 auto; }
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 40px; }
  .toolbar .btn { flex: 1 1 calc(50% - 8px); text-align: center; }
  .tbl-wrap { max-height: none; -webkit-overflow-scrolling: touch; }
  .toast { left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); max-width: none; }
  .login-box { width: min(440px, calc(100vw - 24px)); padding: 22px 16px; }
  .cards, .summary-kpis { grid-template-columns: 1fr 1fr; }
}
@media screen and (max-width: 420px) {
  .cards, .summary-kpis { grid-template-columns: 1fr; }
  .toolbar .btn { flex-basis: 100%; }
}
@media print { .menu-toggle, .nav-search { display: none !important; } }
:root .navigation-row { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(140px, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 0; }
.stock-error, #navigation-error { color: #b91c1c; }
@media (max-width: 600px) { .navigation-row strong { grid-column: 1 / -1; } }
:root [hidden] { display: none !important; }
