/* =============================================
   mobile.css — Pulse Track Mobile Overrides
   ============================================= */

/* ── Core touch targets ── */
*, *::before, *::after { -webkit-tap-highlight-color: transparent; }

/* ── Prevent iOS input zoom ── */
input, select, textarea {
    font-size: 16px !important;
}

@media (max-width: 768px) {

  /* ── TOP NAV (bag_handover, handover_management etc) ── */
  .top-nav {
    flex-wrap: wrap !important;
    padding: 10px 12px !important;
    gap: 8px !important;
  }
  .nav-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    width: 100% !important;
  }
  .nav-actions a, .nav-btn {
    padding: 8px 12px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
  }
  .brand-chip { width: 100% !important; }
  .hero { padding: 16px 14px !important; }
  .hero h1 { font-size: 20px !important; }
  .hero-panel { display: none !important; }

  /* ── SIDEBAR (dashboard.php) ── */
  .sidebar {
    transform: translateX(260px) !important;
    transition: transform 0.28s ease !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 0 0 0 100vw rgba(0,0,0,.55) !important;
  }
  .main { margin-right: 0 !important; }
  .content { padding: 14px !important; }
  .menu-toggle { display: grid !important; }

  /* ── TABLES ── */
  .table-responsive, table {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  table { min-width: 540px !important; }
  .table th, .table td { white-space: nowrap !important; font-size: 12px !important; padding: 8px 10px !important; }

  /* ── STAT/METRIC GRIDS ── */
  .stat-grid, .stats-grid, .row.g-3, .quick-actions {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .col-md-3, .col-md-4 { width: 50% !important; }
  .col-lg-3, .col-lg-4 { width: 50% !important; }

  /* ── MODALS ── */
  .modal-dialog {
    margin: 8px !important;
    max-width: calc(100vw - 16px) !important;
  }
  .modal-content { border-radius: 16px !important; }

  /* ── BUTTONS ── */
  .btn, button[type=submit], .qa-btn {
    min-height: 44px !important;
    font-size: 14px !important;
  }
  .btn-group .btn { min-height: 38px !important; font-size: 12px !important; }

  /* ── FORMS ── */
  .form-control, .form-select {
    min-height: 46px !important;
    border-radius: 10px !important;
  }

  /* ── CARDS ── */
  .bag-card, .card-box, .ev-card, .stat-card {
    border-radius: 14px !important;
    margin-bottom: 12px !important;
  }

  /* ── MODE TABS ── */
  .mode-tabs {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    scrollbar-width: none !important;
  }
  .mode-tabs::-webkit-scrollbar { display: none !important; }
  .mode-link { font-size: 12px !important; padding: 8px 12px !important; }

  /* ── PAGE HEADERS ── */
  .page-header, .page-title { font-size: 18px !important; }
  .card-head { font-size: 13px !important; padding: 12px 14px !important; }

  /* ── HIDE NON-ESSENTIAL COLUMNS ── */
  .d-none-mobile { display: none !important; }

  /* ── SPACING ── */
  .container-fluid { padding: 12px !important; }
  .p-4 { padding: 16px !important; }
  .p-3 { padding: 12px !important; }
  .mb-4 { margin-bottom: 16px !important; }

  /* ── event_movements & field portals ── */
  .stat-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .ev-head { flex-direction: column !important; align-items: flex-start !important; }
  .top-bar { flex-direction: column !important; align-items: flex-start !important; }
  .nav-links { width: 100% !important; overflow-x: auto; flex-wrap: nowrap !important; padding-bottom: 4px; }
  .nav-links::-webkit-scrollbar { display: none; }

  /* ── handover_management sessions table ── */
  .sessions-table-wrap { overflow-x: auto !important; }

  /* ── Floating action buttons ── */
  .fab { bottom: 20px !important; left: 20px !important; right: auto !important; }
}

@media (max-width: 480px) {
  .stat-grid, .stats-grid { grid-template-columns: 1fr 1fr !important; }
  .stat-n, .stat-value { font-size: 24px !important; }
  h1 { font-size: 18px !important; }
  .hero h1 { font-size: 17px !important; }
  .btn-new, .btn-confirm, .btn-return, .btn-handoff {
    padding: 16px !important;
    font-size: 16px !important;
    border-radius: 14px !important;
  }
}
