/* ============================================================
   MOBILE VIEWPORT OPTIMIZATIONS (DASHBOARD, FUEL METERS & DOCS)
   Targeted strictly to mobile devices (max-width: 768px).
   Desktop view remains 100% untouched.
   ============================================================ */

@media (max-width: 900px) {
  .hero-main-deck {
    flex-direction: column !important;
    margin-bottom: 0.75rem !important;
    gap: 0.5rem !important;
  }
  .hero-deck-left {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-height: 0 !important;
    max-width: 100% !important;
  }
  .hero-telemetry-hud {
    width: 100% !important;
    justify-content: space-between !important;
  }
}

@media (max-width: 768px) {
  /* 1. OPERATIONS COMMAND & LOGISTICS HUB (MOBILE HERO DECK) */
  .home-hub-hero {
    padding: 0.85rem 0.75rem 0.95rem 0.75rem !important;
    margin-bottom: 0.85rem !important;
    border-radius: 14px !important;
  }
  .hero-deck-left {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-height: 0 !important;
  }
  .hero-cyber-badge {
    margin-bottom: 0.35rem !important;
    padding: 0.18rem 0.55rem !important;
  }
  .hero-cyber-badge .badge-text {
    font-size: 0.65rem !important;
  }
  .hero-cyber-badge .badge-tag {
    font-size: 0.58rem !important;
  }
  .hero-cyber-title {
    font-size: 1.18rem !important;
    margin-bottom: 0.2rem !important;
    line-height: 1.25 !important;
  }
  .hero-cyber-desc {
    font-size: 0.74rem !important;
    line-height: 1.35 !important;
  }
  .hero-telemetry-hud {
    display: none !important;
  }

  /* Command Launchpad Buttons (2-Column Grid, Clean & Compact) */
  .hero-command-launchpad {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.45rem !important;
    width: 100% !important;
  }
  .cyber-launch-btn {
    padding: 0.55rem 0.55rem !important;
    gap: 0.45rem !important;
    border-radius: 10px !important;
    min-width: 0 !important;
  }
  .cyber-btn-icon-box {
    width: 32px !important;
    height: 32px !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
  }
  .cyber-btn-icon-box svg {
    width: 17px !important;
    height: 17px !important;
  }
  .cyber-btn-text {
    min-width: 0 !important;
    flex: 1 !important;
  }
  .cyber-btn-top {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.15rem !important;
  }
  .cyber-btn-title {
    font-size: 0.76rem !important;
    font-weight: 700 !important;
    white-space: normal !important;
    line-height: 1.2 !important;
    overflow: visible !important;
    text-overflow: unset !important;
    word-break: break-word !important;
  }
  .cyber-btn-badge {
    font-size: 0.52rem !important;
    padding: 0.08rem 0.3rem !important;
    border-radius: 4px !important;
  }
  .cyber-btn-sub {
    display: none !important;
  }

  /* 2. UNIFIED SLIDING BANNER & VIEWPORT */
  .dashboard-sliding-banner-card {
    margin: 0.85rem 0 1.25rem 0 !important;
    border-radius: 14px !important;
  }
  .banner-slide {
    padding: 0.65rem 0.55rem !important;
  }
  /* Hide intrusive floating arrows on mobile */
  .banner-slider-arrow {
    display: none !important;
  }
  .banner-slide-subhead {
    padding: 0.5rem 0.65rem !important;
    margin-bottom: 0.6rem !important;
    border-radius: 10px !important;
  }
  .slide-subhead-icon {
    width: 28px !important;
    height: 28px !important;
    font-size: 1rem !important;
    border-radius: 8px !important;
  }
  .slide-subhead-title {
    font-size: 0.88rem !important;
  }
  .slide-subhead-desc {
    font-size: 0.68rem !important;
    line-height: 1.3 !important;
  }
  .fuel-scroll-arrows {
    display: none !important;
  }

  /* 3. WINCH FLEET REAL-TIME FUEL METERS (COMPLETE 4 WINCHES ON MOBILE) */
  .dashboard-fuel-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.55rem !important;
    overflow-x: visible !important;
    padding-bottom: 0 !important;
    width: 100% !important;
  }
  .dashboard-fuel-grid > * {
    min-width: 0 !important;
    width: 100% !important;
    flex-shrink: 1 !important;
    padding: 0.65rem 0.55rem !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
  }
  .gauge-wrapper {
    padding: 0.1rem 0 !important;
  }
  .automotive-fuel-gauge {
    max-width: 105px !important;
    max-height: 105px !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
  }
  .tank-mode-pills {
    margin: 0.35rem 0 0.2rem 0 !important;
    padding: 0.15rem !important;
    gap: 0.15rem !important;
    border-radius: 6px !important;
  }
  .tank-mode-btn {
    padding: 0.2rem 0.1rem !important;
    font-size: 0.58rem !important;
    font-weight: 700 !important;
    border-radius: 4px !important;
  }
  .digital-meter-screen {
    padding: 0.35rem 0.45rem !important;
    border-radius: 8px !important;
  }
  .meter-sub-row {
    font-size: 0.64rem !important;
  }
  .meter-bar-track {
    height: 4px !important;
    margin-top: 2px !important;
  }

  /* 4. VEHICLE STATUTORY DOCUMENTS & VALIDITY (COMPLETE 4 VEHICLES & ALL 4 DOCS) */
  .dashboard-statutory-matrix-wrap {
    padding: 0 !important;
  }
  .dashboard-statutory-matrix-wrap > div:first-child {
    margin-bottom: 0.65rem !important;
  }
  .dashboard-statutory-matrix-wrap h3 {
    font-size: 0.95rem !important;
  }
  .dashboard-statutory-matrix-wrap p {
    font-size: 0.72rem !important;
  }
  .table-responsive {
    overflow-x: visible !important;
  }
  .dashboard-statutory-matrix-table {
    min-width: 0 !important;
    width: 100% !important;
    display: block !important;
  }
  .dashboard-statutory-matrix-table thead {
    display: none !important;
  }
  .dashboard-statutory-matrix-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.65rem !important;
    width: 100% !important;
  }
  .dashboard-statutory-matrix-table tbody tr.dashboard-stat-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-areas:
      "veh veh"
      "tax puc"
      "ins permit" !important;
    gap: 0.45rem !important;
    background: rgba(15, 23, 42, 0.75) !important;
    border: 1px solid rgba(56, 189, 248, 0.2) !important;
    border-radius: 12px !important;
    padding: 0.65rem 0.75rem !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3) !important;
  }
  .stat-cell-veh {
    grid-area: veh !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0 0 0.45rem 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    margin-bottom: 0.2rem !important;
  }
  .stat-veh-meta {
    display: flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
  }
  .stat-veh-icon {
    font-size: 1.1rem !important;
    display: inline-block !important;
  }
  .stat-veh-title {
    font-weight: 800 !important;
    font-size: 0.88rem !important;
    color: #ffffff !important;
    font-family: 'JetBrains Mono', monospace !important;
    letter-spacing: 0.3px !important;
  }
  .stat-veh-sub {
    font-size: 0.68rem !important;
    color: #94a3b8 !important;
    font-weight: 500 !important;
  }
  .stat-veh-badge-mobile {
    display: block !important;
  }
  .stat-cell-doc {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    min-width: 0 !important;
  }
  .stat-cell-tax { grid-area: tax !important; }
  .stat-cell-puc { grid-area: puc !important; }
  .stat-cell-ins { grid-area: ins !important; }
  .stat-cell-permit { grid-area: permit !important; }

  .mobile-doc-tag {
    display: block !important;
    font-size: 0.62rem !important;
    font-weight: 800 !important;
    color: #93c5fd !important;
    letter-spacing: 0.4px !important;
    margin-bottom: 0.15rem !important;
    text-transform: uppercase !important;
  }
  .dashboard-statutory-matrix-table .compliance-pill {
    max-width: 100% !important;
    min-width: 0 !important;
    width: 100% !important;
    padding: 0.35rem 0.5rem !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
  }
  .dashboard-statutory-matrix-table .compliance-date {
    font-size: 0.74rem !important;
  }
  .dashboard-statutory-matrix-table .compliance-status-label {
    font-size: 0.58rem !important;
    margin-top: 2px !important;
  }

  /* Slide Switcher Bottom Tabs on Mobile */
  .banner-switcher-tabs {
    width: 100% !important;
    display: flex !important;
  }
  .banner-tab-pill {
    flex: 1 !important;
    padding: 0.35rem 0.45rem !important;
    font-size: 0.7rem !important;
    justify-content: center !important;
    text-align: center !important;
  }
}

@media (min-width: 769px) {
  .mobile-doc-tag {
    display: none !important;
  }
  .stat-veh-badge-mobile {
    display: none !important;
  }
  .stat-veh-icon {
    display: none !important;
  }
}



/* ======================================================= */
/* USER PROFILE MODAL & MOBILE OPTIMIZATIONS                */
/* ======================================================= */
.modal-user-profile {
  border: 1px solid rgba(0, 112, 242, 0.3) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45) !important;
}

@media (max-width: 600px) {
  .modal-user-profile {
    max-height: 94vh !important;
    width: 95% !important;
    margin: 0.5rem auto !important;
  }
  .modal-user-profile .modal-body {
    padding: 1rem !important;
    gap: 0.9rem !important;
  }
  .modal-user-profile .profile-photo-card {
    padding: 0.75rem 0.85rem !important;
    gap: 0.85rem !important;
  }
  .modal-user-profile .profile-avatar-wrapper {
    width: 66px !important;
    height: 66px !important;
  }
  .modal-user-profile .profile-avatar-wrapper #profileAvatarPreview {
    font-size: 1.4rem !important;
  }
}
