/* ==========================================================
   FIXFLEET DISPATCH
========================================================== */

.ff-dispatch-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  margin-bottom:18px;
}

.ff-dispatch-head h1{
  margin:4px 0 6px;
}

.ff-dispatch-head-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.ff-dispatch-summary{
  display:grid;
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:10px;
  margin-bottom:16px;
}

.ff-dispatch-stat{
  padding:14px;
  border:1px solid rgba(255,255,255,.075);
  border-radius:14px;
  background:rgba(255,255,255,.03);
}

.ff-dispatch-stat-label{
  font-size:10px;
  font-weight:900;
  letter-spacing:.6px;
  text-transform:uppercase;
  opacity:.62;
}

.ff-dispatch-stat-value{
  margin-top:5px;
  font-size:24px;
  font-weight:950;
}

.ff-dispatch-toolbar{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin-bottom:16px;
}

.ff-dispatch-range{
  flex:1;
  min-width:220px;
  text-align:center;
  font-size:18px;
  font-weight:900;
}

.ff-dispatch-toggle{
  display:flex;
  gap:4px;
  padding:4px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:12px;
}

.ff-dispatch-toggle button{
  border:0;
  border-radius:8px;
  padding:8px 13px;
  background:transparent;
  color:inherit;
  cursor:pointer;
  font-weight:900;
}

.ff-dispatch-toggle button.active{
  background:rgba(84,200,255,.15);
}

.ff-dispatch-columns{
  display:grid;
  grid-template-columns:minmax(0,2fr) minmax(280px,1fr);
  gap:14px;
}

.ff-dispatch-panel{
  overflow:hidden;
  border:1px solid rgba(255,255,255,.075);
  border-radius:14px;
}

.ff-dispatch-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:13px;
  background:rgba(255,255,255,.03);
  border-bottom:1px solid rgba(255,255,255,.06);
}

.ff-dispatch-list{
  padding:10px;
  display:grid;
  gap:8px;
}

.ff-dispatch-allocation{
  padding:12px;
  border:1px solid rgba(255,255,255,.075);
  border-radius:11px;
  background:rgba(255,255,255,.02);
}

.ff-dispatch-allocation-top{
  display:flex;
  justify-content:space-between;
  gap:10px;
}

.ff-dispatch-reg{
  font-size:15px;
  font-weight:950;
}

.ff-dispatch-driver{
  margin-top:2px;
  font-weight:800;
}

.ff-dispatch-meta{
  margin-top:7px;
  font-size:11px;
  line-height:1.55;
  opacity:.7;
}

.ff-dispatch-actions{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  margin-top:10px;
}

.ff-dispatch-badge{
  display:inline-block;
  padding:4px 7px;
  border-radius:7px;
  font-size:9px;
  font-weight:900;
  text-transform:uppercase;
  background:rgba(84,200,255,.12);
}

.ff-dispatch-driver-card,
.ff-dispatch-vehicle-card{
  padding:10px;
  border:1px solid rgba(255,255,255,.07);
  border-radius:10px;
}

.ff-dispatch-driver-card strong,
.ff-dispatch-vehicle-card strong{
  display:block;
}

.ff-dispatch-small{
  margin-top:4px;
  font-size:11px;
  opacity:.65;
}

.ff-dispatch-warning{
  margin-top:7px;
  padding:7px 9px;
  border-radius:8px;
  border:1px solid rgba(255,175,45,.27);
  background:rgba(255,175,45,.065);
  font-size:11px;
}

.ff-dispatch-blocked{
  opacity:.55;
}

.ff-dispatch-week{
  display:grid;
  grid-template-columns:repeat(7,minmax(165px,1fr));
  gap:8px;
  overflow-x:auto;
  padding-bottom:8px;
}

.ff-dispatch-day{
  min-width:165px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.07);
  border-radius:13px;
}

.ff-dispatch-day.today{
  border-color:rgba(84,200,255,.42);
}

.ff-dispatch-day-head{
  padding:10px;
  border-bottom:1px solid rgba(255,255,255,.06);
}

.ff-dispatch-day-name{
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  opacity:.6;
}

.ff-dispatch-day-date{
  margin-top:3px;
  font-size:17px;
  font-weight:950;
}

.ff-dispatch-day-body{
  min-height:190px;
  padding:7px;
}

.ff-dispatch-week-card{
  margin-bottom:7px;
  padding:8px;
  border:1px solid rgba(255,255,255,.075);
  border-radius:9px;
  background:rgba(255,255,255,.025);
}

.ff-dispatch-week-card .reg{
  font-size:12px;
  font-weight:950;
}

.ff-dispatch-week-card .driver{
  margin-top:2px;
  font-size:11px;
}

.ff-dispatch-week-card .time{
  margin-top:5px;
  font-size:10px;
  opacity:.65;
}

.ff-dispatch-empty{
  padding:12px;
  font-size:12px;
  opacity:.55;
}

.ff-dispatch-modal-backdrop{
  position:fixed;
  inset:0;
  z-index:10100;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  background:rgba(0,0,0,.68);
}

.ff-dispatch-modal{
  width:min(680px,100%);
  max-height:90vh;
  overflow:auto;
  box-sizing:border-box;
  padding:20px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.12);
  background:#10151d;
  box-shadow:0 24px 90px rgba(0,0,0,.5);
}

.ff-dispatch-modal h2{
  margin:0 0 5px;
}

.ff-dispatch-modal-sub{
  margin-bottom:17px;
  opacity:.66;
}

.ff-dispatch-form{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.ff-dispatch-field{
  display:grid;
  gap:5px;
}

.ff-dispatch-field.full{
  grid-column:1 / -1;
}

.ff-dispatch-field label{
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  opacity:.65;
}

.ff-dispatch-field input,
.ff-dispatch-field select,
.ff-dispatch-field textarea{
  width:100%;
  box-sizing:border-box;
  padding:10px 11px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.11);
  background:rgba(255,255,255,.045);
  color:inherit;
}

.ff-dispatch-field textarea{
  min-height:75px;
  resize:vertical;
}

.ff-dispatch-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
  margin-top:18px;
}

.ff-dispatch-history{
  display:grid;
  gap:8px;
}

.ff-dispatch-history-row{
  padding:10px;
  border:1px solid rgba(255,255,255,.07);
  border-radius:10px;
}

@media(max-width:950px){

  .ff-dispatch-columns{
    grid-template-columns:1fr;
  }

  .ff-dispatch-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

}

@media(max-width:600px){

  .ff-dispatch-head{
    display:block;
  }

  .ff-dispatch-head-actions{
    margin-top:12px;
  }

  .ff-dispatch-form{
    grid-template-columns:1fr;
  }

  .ff-dispatch-field.full{
    grid-column:auto;
  }

}


/* FIXFLEET MOBILE MODAL POLISH */

.ff-dispatch-modal{
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}

@supports (height:100dvh){

  .ff-dispatch-modal{
    max-height:
      calc(
        100dvh
        - 24px
        - env(safe-area-inset-top)
        - env(safe-area-inset-bottom)
      );
  }

}

@media(max-width:600px){

  .ff-dispatch-modal-backdrop{
    align-items:flex-start;

    padding:
      max(12px,env(safe-area-inset-top))
      max(12px,env(safe-area-inset-right))
      max(12px,env(safe-area-inset-bottom))
      max(12px,env(safe-area-inset-left));
  }

  .ff-dispatch-modal{
    width:100%;
    padding:16px;
    border-radius:16px;
  }

}
