/* ============================================================
   JZ 订货系统 · 移动端适配（所有后台页面共享）
   在手机浏览器上：侧边栏 → 顶部横滑导航；表格可横滑；间距/字号手机化
   ============================================================ */

@media (max-width: 768px) {

  /* ---------- 侧边栏 → 顶部横滑导航 ---------- */
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 1050;
    min-height: auto !important;
    padding: 6px 8px !important;
    background: #1a365d !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
  }
  /* 隐藏品牌标题，节省纵向空间 */
  .sidebar > .text-white {
    display: none !important;
  }
  .sidebar .nav {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 4px;
    padding-bottom: 2px;
  }
  .sidebar .nav-item {
    flex-shrink: 0;
    margin-top: 0 !important;
  }
  .sidebar .nav-link {
    white-space: nowrap;
    padding: 8px 12px !important;
    margin-bottom: 0 !important;
    font-size: 13px;
  }
  .sidebar .nav-link .bi {
    margin-right: 4px !important;
  }

  /* ---------- 主内容 ---------- */
  main {
    padding: 12px !important;
  }
  .container-fluid {
    padding: 0;
  }
  h4 {
    font-size: 1.15rem !important;
  }
  h5 {
    font-size: 1.02rem !important;
  }
  h6 {
    font-size: .95rem !important;
  }

  /* ---------- 卡片与统计 ---------- */
  .card,
  .stat-card,
  .chart-card {
    border-radius: 10px !important;
  }
  .stat-card .card-body,
  .chart-card {
    padding: 14px !important;
  }
  .stat-card h3 {
    font-size: 1.3rem !important;
  }
  .chart-container {
    height: 200px !important;
  }
  .chart-container.pie {
    height: 190px !important;
  }

  /* ---------- 表格：允许横向滑动，避免撑破页面 ---------- */
  .table-responsive {
    -webkit-overflow-scrolling: touch;
  }
  .table-responsive .table {
    font-size: 13px;
    min-width: 480px; /* 内容窄的表会自动贴满，宽的表横向滑动 */
  }
  .table-responsive th,
  .table-responsive td {
    white-space: nowrap;
    padding: 6px 8px !important;
  }

  /* ---------- 按钮/输入框：手机点击友好 ---------- */
  .btn {
    min-height: 38px;
    font-size: 14px;
  }
  .btn-sm {
    min-height: 32px;
  }
  .form-control,
  .form-select,
  .input-group-text {
    font-size: 15px !important;
  }

  /* ---------- 弹窗 ---------- */
  .modal-dialog {
    margin: .5rem;
    max-width: none !important;
  }

  /* ---------- 底部固定栏（新建订单等页面） ---------- */
  .bottom-bar {
    padding: 10px 12px !important;
  }
  .bottom-bar .btn-submit {
    min-height: 44px;
    font-size: 15px;
  }

  /* ---------- 聊天/问数页 ---------- */
  .chat-card {
    height: calc(100vh - 160px) !important;
    min-height: 400px !important;
  }
  .msg {
    max-width: 92% !important;
    font-size: .9rem !important;
  }
  .quick-chips .chip {
    font-size: .8rem !important;
    padding: 5px 12px !important;
  }

  /* ---------- 预警页 ---------- */
  .alert-card .table-responsive .table {
    min-width: 380px;
  }

  /* ---------- 表单区 ---------- */
  .customer-select-area,
  .discount-area,
  .form-group {
    margin-bottom: 12px !important;
  }
}
