/* ═══════════════════════════════════════════════════════════════
   TradeForge — Crew Pilot Mode
   Simplified, mobile-first workspace for real crews with no training.
   Core actions: Log Update, Upload Photo, Track Progress, Next Steps.
   ═══════════════════════════════════════════════════════════════ */

/* ── Crew Quick Actions Bar ── */
.crew-quick-actions{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:10px;
  margin:0 0 18px;
  padding:0
}
.crew-action-btn{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  padding:18px 10px;
  background:linear-gradient(135deg,rgba(46,49,54,.6) 0%,rgba(30,32,35,.7) 100%);
  border:1px solid rgba(140,106,62,.25);
  border-radius:14px;
  color:var(--ash,#B5B7B9);
  cursor:pointer;
  transition:all .2s;
  font-size:0;
  min-height:48px;
  -webkit-tap-highlight-color:transparent
}
.crew-action-btn svg{
  width:26px;
  height:26px;
  color:var(--bronze,#8C6A3E);
  flex-shrink:0
}
.crew-action-btn span{
  font-size:12px;
  font-weight:700;
  letter-spacing:.02em;
  text-align:center;
  line-height:1.3
}
.crew-action-btn:hover,
.crew-action-btn:active{
  border-color:var(--bronze,#8C6A3E);
  background:rgba(140,106,62,.12);
  color:#fff
}
.crew-action-btn:active{
  transform:scale(.96)
}

/* ── Mobile-First: Simplified Bottom Nav ── */
@media(max-width:768px){
  /* Make mobile nav items larger for gloved fingers */
  .pe-mobile-nav{
    padding:8px 12px calc(8px + env(safe-area-inset-bottom,0px))
  }
  .pe-mobile-nav-inner{
    display:flex;
    justify-content:space-around;
    gap:4px
  }
  .pe-mobile-nav a{
    padding:10px 8px;
    font-size:11px;
    font-weight:700;
    min-width:0;
    flex:1
  }
  .pe-mobile-nav a svg{
    width:24px;
    height:24px
  }

  /* Larger body padding for bottom nav */
  body{
    padding-bottom:88px!important
  }

  /* Photo FAB positioned above bottom nav */
  .pe-photo-fab{
    bottom:calc(88px + env(safe-area-inset-bottom,0px) + 14px)!important;
    width:60px!important;
    height:60px!important
  }

  /* Hide non-essential elements on mobile */
  .crew-hide-mobile{
    display:none!important
  }

  /* Simplify header on mobile */
  .pe-header h1{
    font-size:22px
  }

  /* Crew quick actions: 2x2 grid on mobile */
  .crew-quick-actions{
    grid-template-columns:repeat(2,1fr);
    gap:8px
  }
  .crew-action-btn{
    padding:16px 8px;
    min-height:72px
  }
  .crew-action-btn svg{
    width:28px;
    height:28px
  }
  .crew-action-btn span{
    font-size:13px
  }

  /* Make tab bar items larger for touch */
  .pe-tab{
    padding:12px 18px;
    font-size:14px;
    min-height:44px
  }
  .pe-tab svg{
    width:18px;
    height:18px
  }

  /* Larger touch targets on cards and buttons */
  .btn,.badge{
    min-height:44px;
    display:inline-flex;
    align-items:center
  }

  /* Ensure inputs don't trigger iOS zoom */
  .input,input,select,textarea{
    font-size:16px!important
  }
}

/* ── Tablet Optimizations ── */
@media(min-width:769px) and (max-width:1024px){
  .crew-quick-actions{
    grid-template-columns:repeat(4,1fr);
    gap:12px
  }
  .crew-action-btn{
    padding:20px 12px;
    min-height:80px
  }
  .crew-action-btn svg{
    width:30px;
    height:30px
  }
  .crew-action-btn span{
    font-size:13px
  }

  /* Hide system flow on tablet too */
  .crew-hide-mobile{
    display:none!important
  }
}

/* ── Desktop: Quick actions as horizontal strip ── */
@media(min-width:1025px){
  .crew-quick-actions{
    grid-template-columns:repeat(4,1fr);
    gap:12px;
    margin:0 0 20px
  }
  .crew-action-btn{
    flex-direction:row;
    gap:10px;
    padding:14px 18px;
    min-height:48px
  }
  .crew-action-btn svg{
    width:22px;
    height:22px
  }
  .crew-action-btn span{
    font-size:13px;
    font-weight:650
  }
}

/* ── CC Secondary Panels: Simplify on small screens ── */
@media(max-width:768px){
  /* Single column grid on mobile */
  .cc-grid{
    grid-template-columns:1fr!important
  }

  /* Reduce panel padding on mobile */
  .cc-panel{
    padding:14px
  }

  /* Compact the map on mobile */
  #cc-location-map{
    max-height:160px;
    overflow:hidden
  }

  /* Hide readiness gauge detail on mobile — show score only */
  .cc-readiness-categories{
    display:none
  }
  .cc-readiness-gauge{
    margin:0 auto
  }

  /* Compact KPI rows */
  .cc-kpi-row{
    flex-wrap:wrap;
    gap:6px
  }
}
