/* Mobile shell — hidden by default; shown only ≤980px */

.mobile-topbar,
.nav-backdrop,
.menu-toggle {
  display: none !important;
}

@media (max-width: 980px) {
  .app-shell {
    display: block;
    min-height: 100dvh;
  }

  .mobile-topbar {
    display: flex !important;
    position: sticky;
    top: 0;
    z-index: 40;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .85rem 1rem;
    padding-top: calc(.85rem + env(safe-area-inset-top, 0px));
    background: #14202b;
    color: #e8eef2;
    border-bottom: 1px solid #314354;
  }

  .mobile-brand {
    font-family: var(--font-display);
    font-size: 1.15rem;
    line-height: 1.2;
  }

  .mobile-brand span {
    display: block;
    font-family: var(--font-ui);
    font-size: .68rem;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #9db0c2;
    margin-top: .15rem;
  }

  .menu-toggle {
    display: inline-flex !important;
    appearance: none;
    border: 1px solid #314354;
    background: #1a2b38;
    color: #e8eef2;
    border-radius: 10px;
    width: 2.6rem;
    height: 2.6rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .28rem;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
  }

  .menu-toggle span {
    display: block;
    width: 1.15rem;
    height: 2px;
    background: #e8eef2;
    border-radius: 2px;
  }

  .nav-backdrop {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(12, 20, 28, .55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  body.nav-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: min(84vw, 300px);
    height: 100dvh;
    max-height: 100dvh;
    overflow-y: auto;
    padding: 1.25rem 1rem;
    padding-top: calc(1.25rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: none;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
    box-shadow: 12px 0 32px rgba(0, 0, 0, .35);
  }

  .sidebar .brand {
    display: none;
  }

  .nav {
    flex-direction: column;
    gap: .35rem;
  }

  .nav a {
    font-size: 1.05rem;
    padding: .9rem 1rem;
    min-height: 2.75rem;
  }

  .sidebar-foot {
    margin-top: auto;
    padding-top: 1rem;
  }

  .main {
    min-height: auto;
    padding: 1rem 1rem 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .main-content {
    padding-bottom: 1.5rem;
  }

  .jump-panel {
    position: static;
    top: auto;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar h1 {
    font-size: 1.45rem;
  }

  .actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .actions .btn {
    flex: 1 1 auto;
  }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .quick-row {
    grid-template-columns: 1fr;
  }

  .batch-table-wrap {
    margin: 0 -.25rem;
  }

  body.nav-open {
    overflow: hidden;
  }
}
