﻿:root{
  --veh-surface: #ffffff;
  --veh-surface-2: #f8fafc;
  --veh-surface-3: #f1f5f9;
  --veh-border: rgba(11,15,25,.10);
  --veh-text: rgba(11,15,25,.92);
  --veh-muted: rgba(11,15,25,.62);
  --veh-shadow: 0 12px 28px rgba(11,15,25,.12);
  --veh-brand: var(--gold, #F9D515);
}

/* Panels and shared sub-menu header */
#sideDrawer .vehiclesPanel,
#sideDrawer #vehicleDetailBox.vehicleDetailBox{
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--veh-surface), var(--veh-surface-2));
  color: var(--veh-text);
  padding: 12px;
  overflow-y: auto;
}

#sideDrawer .vehiclesPanelHeader,
#sideDrawer #vehicleDetailBox .vehicleDetailHeader{
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px -4px 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--veh-border);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#sideDrawer .vehiclesPanelTitle,
#sideDrawer #vehicleDetailBox .vehicleDetailTitle{
  font-size: 15px;
  font-weight: 1000;
  letter-spacing: .2px;
  color: var(--veh-text);
}

#sideDrawer .btnBack,
#sideDrawer #btnBackVehicleDetail.vehicleBtn{
  width: 40px;
  min-width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--veh-border);
  background: var(--veh-surface);
  color: var(--veh-text);
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#sideDrawer .btnBack:hover,
#sideDrawer #btnBackVehicleDetail.vehicleBtn:hover{
  background: var(--veh-surface-3);
}

#sideDrawer .drawerBody{
  padding: 4px 2px 12px;
}

/* List view */
#sideDrawer .vehiclesList{
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(88vh - 190px);
  overflow: auto;
  padding-right: 2px;
}

#sideDrawer .vehicleItem{
  border: 1px solid var(--veh-border);
  background: var(--veh-surface);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--veh-shadow);
}

#sideDrawer .vehicleItem.active{
  border-color: rgba(249,213,21,.60);
  box-shadow: 0 12px 28px rgba(249,213,21,.22);
}

#sideDrawer .vehicleTop{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

#sideDrawer .vehicleName{
  font-weight: 900;
  font-size: 13.5px;
  line-height: 1.25;
  color: var(--veh-text);
}

#sideDrawer .vehicleMeta{
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--veh-muted);
}

#sideDrawer .vehicleStatus{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--veh-border);
  background: rgba(11,15,25,.05);
  color: var(--veh-text);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

#sideDrawer .vehicleStatus.st-ok{
  background: rgba(46,204,113,.16);
  border-color: rgba(46,204,113,.36);
  color: #155737;
}

#sideDrawer .vehicleStatus.st-pending{
  background: rgba(249,213,21,.24);
  border-color: rgba(249,213,21,.55);
  color: #513f00;
}

#sideDrawer .vehicleStatus.st-bad{
  background: rgba(255,77,77,.14);
  border-color: rgba(255,77,77,.36);
  color: #8a1e1e;
}

#sideDrawer .vehicleActions{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

#sideDrawer .vehicleBtn{
  appearance: none;
  border: 1px solid var(--veh-border);
  background: var(--veh-surface);
  color: var(--veh-text);
  border-radius: 12px;
  padding: 11px 10px;
  font-weight: 900;
  font-size: 12.5px;
  cursor: pointer;
}

#sideDrawer .vehicleBtn:hover{
  background: var(--veh-surface-3);
}

#sideDrawer .vehicleBtn.primary,
#sideDrawer .btnPrimaryFull{
  background: var(--veh-brand);
  border: 1px solid rgba(11,15,25,.12);
  color: #111;
}

#sideDrawer .vehicleBtn.primary:hover,
#sideDrawer .btnPrimaryFull:hover{
  filter: brightness(.98);
}

#sideDrawer .vehicleBtn:disabled,
#sideDrawer .btnPrimaryFull:disabled{
  opacity: .48;
  cursor: not-allowed;
}

#sideDrawer .smallHint{
  margin-top: 10px;
  font-size: 12px;
  color: var(--veh-muted);
  opacity: 1;
  display: block;
}

/* Add vehicle wizard */
#addVehiclePanel .fieldLabel{
  display: block;
  margin: 10px 0 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--veh-text);
}

#addVehiclePanel .input,
#addVehiclePanel select,
#profilePanel select,
#profilePanel .input{
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--veh-border);
  background: var(--veh-surface);
  color: var(--veh-text);
  padding: 0 12px;
  outline: none;
}

#addVehiclePanel .input::placeholder,
#profilePanel .input::placeholder{
  color: rgba(11,15,25,.44);
}

#addVehiclePanel .input:focus,
#addVehiclePanel select:focus,
#profilePanel .input:focus,
#profilePanel select:focus{
  border-color: rgba(249,213,21,.62);
  box-shadow: 0 0 0 3px rgba(249,213,21,.18);
}

#addVehiclePanel .wizSteps{
  display: flex;
  gap: 8px;
  align-items: center;
}

#addVehiclePanel .wizStep{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  color: rgba(11,15,25,.55);
  border: 1px solid var(--veh-border);
  background: rgba(11,15,25,.04);
}

#addVehiclePanel .wizStep.is-on{
  color: #111;
  border-color: rgba(249,213,21,.62);
  background: rgba(249,213,21,.58);
}

#addVehiclePanel .formErr,
#profilePanel .formErr,
#addVehiclePanel #vehAddErr,
#profilePanel #profileErr{
  min-height: 18px;
  margin-top: 8px;
  font-size: 12px;
  color: #c12335;
}

/* Inspection (step 2) */
#vehPage2{
  color: var(--veh-text);
}

#vehInspectionWrap{
  background: var(--veh-surface);
  border: 1px solid var(--veh-border);
  border-radius: 16px;
  box-shadow: var(--veh-shadow);
  padding: 12px;
}

#vehInspectionTitle{
  margin: 2px 0 6px;
  font-size: 16px;
  font-weight: 900;
  color: var(--veh-text);
}

#vehInspectionHint{
  margin: 0 0 10px;
  font-size: 12.5px;
  color: var(--veh-muted);
}

.vehInspectionBox{
  position: relative;
  border: 1px solid var(--veh-border);
  border-radius: 14px;
  overflow: hidden;
  background: #e5e7eb;
}

#vehInspectionVideo,
#vehInspectionPreview{
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.vehInspectionActions{
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.vehInspectionActions > button,
.vehInspectionActions > div > button{
  appearance: none;
  border: 1px solid var(--veh-border);
  border-radius: 12px;
  background: var(--veh-surface);
  color: var(--veh-text);
  font-weight: 800;
  font-size: 13px;
  padding: 10px 12px;
  cursor: pointer;
}

.vehInspectionActions > button:hover,
.vehInspectionActions > div > button:hover{
  background: var(--veh-surface-3);
}

#btnVehOpenCam,
#btnVehUploadNext{
  background: var(--veh-brand);
  border-color: rgba(11,15,25,.16);
  color: #111;
}

.vehInspectionActions > button:disabled,
.vehInspectionActions > div > button:disabled{
  opacity: .45;
  cursor: not-allowed;
}

#vehInspectionFile{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px dashed rgba(11,15,25,.24);
  background: var(--veh-surface-2);
  color: var(--veh-muted);
  font-size: 13px;
}

.vehInspectionActions > div{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 0 !important;
}

#vehInspectionErr{
  margin-top: 2px !important;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,77,77,.30);
  background: rgba(255,77,77,.10);
  color: #8a1e1e;
  font-weight: 700;
  font-size: 12px;
  display: none;
}

#vehInspectionErr:not(:empty){
  display: block;
}

#vehPage3 .wizDoneTitle{
  font-weight: 1000;
  font-size: 16px;
  color: var(--veh-text);
}

/* Profile panel adjustments for contrast */
#profilePanel .pfStatusBox{
  margin: 2px 0 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--veh-surface);
  border: 1px solid var(--veh-border);
  box-shadow: var(--veh-shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#profilePanel .pfStatusText,
#profilePanel .pfAdminNotesLine > b,
#profilePanel .pfNotes{
  color: var(--veh-text);
}

#profilePanel .pfNotes{
  background: var(--veh-surface-2);
  border: 1px dashed rgba(11,15,25,.24);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 42px;
  font-size: 12.5px;
}

#profilePanel .pfNotes.is-empty{
  opacity: .65;
}

#profilePanel .statusBadge{
  border: 1px solid rgba(11,15,25,.14);
  background: rgba(11,15,25,.06);
  color: rgba(11,15,25,.84);
}

#profilePanel .statusBadge--ok{
  background: rgba(46,204,113,.16);
  border-color: rgba(46,204,113,.36);
  color: #155737;
}

#profilePanel .statusBadge--bad{
  background: rgba(255,77,77,.14);
  border-color: rgba(255,77,77,.36);
  color: #8a1e1e;
}

#profilePanel .statusBadge--muted{
  background: rgba(11,15,25,.06);
  border-color: rgba(11,15,25,.14);
  color: rgba(11,15,25,.68);
}

/* Vehicle detail */
#vehicleDetailBox #vehicleDetailBody{
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#vehicleDetailBox .vehDetailStatusRow,
#vehicleDetailBox .vehDetailGrid,
#vehicleDetailBox .vehColorBox,
#vehicleDetailBox .vehPhotoCard{
  border: 1px solid var(--veh-border);
  border-radius: 14px;
  background: var(--veh-surface);
  box-shadow: var(--veh-shadow);
}

#vehicleDetailBox .vehDetailStatusRow,
#vehicleDetailBox .vehDetailGrid,
#vehicleDetailBox .vehColorBox{
  padding: 12px;
}

#vehicleDetailBox .vehDetailStatusRow{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

#vehicleDetailBox .vehDetailMeta{
  font-size: 12px;
  color: var(--veh-muted);
  line-height: 1.35;
  text-align: right;
}

#vehicleDetailBox .vehDetailMeta b{
  color: var(--veh-text);
}

#vehicleDetailBox .vehDetailStatus{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--veh-border);
  background: rgba(11,15,25,.05);
  color: var(--veh-text);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

#vehicleDetailBox .vehDetailStatus.st-ok{
  background: rgba(46,204,113,.16);
  border-color: rgba(46,204,113,.36);
  color: #155737;
}

#vehicleDetailBox .vehDetailStatus.st-pending{
  background: rgba(249,213,21,.24);
  border-color: rgba(249,213,21,.55);
  color: #513f00;
}

#vehicleDetailBox .vehDetailStatus.st-bad{
  background: rgba(255,77,77,.14);
  border-color: rgba(255,77,77,.36);
  color: #8a1e1e;
}

#vehicleDetailBox .vehDetailGrid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#vehicleDetailBox .vehDetailGrid > div{
  font-size: 13px;
  color: var(--veh-text);
}

#vehicleDetailBox .vehDetailGrid b{
  color: var(--veh-muted);
}

#vehicleDetailBox .vehColorTitle{
  font-weight: 1000;
  font-size: 13px;
  margin-bottom: 8px;
}

#vehicleDetailBox .vehColorInput{
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--veh-border);
  background: var(--veh-surface);
  color: var(--veh-text);
  outline: none;
  padding: 0 12px;
  font-weight: 800;
}

#vehicleDetailBox .vehColorInput::placeholder{
  color: rgba(11,15,25,.44);
}

#vehicleDetailBox .vehColorHint{
  margin-top: 8px;
  font-size: 12px;
  color: var(--veh-muted);
}

#vehicleDetailBox .vehColorHint b{
  color: var(--veh-text);
}

#vehicleDetailBox .vehPhotosTitle{
  margin-top: 2px;
  font-weight: 1000;
  font-size: 13px;
  color: var(--veh-text);
}

#vehicleDetailBox .vehPhotosGrid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#vehicleDetailBox .vehPhotoLabel{
  padding: 10px 10px 8px;
  font-size: 12px;
  font-weight: 900;
  color: var(--veh-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#vehicleDetailBox .vehPhotoCard.ok{
  border-color: rgba(46,204,113,.30);
}

#vehicleDetailBox .vehPhotoCard.ok .vehPhotoLabel{
  background: rgba(46,204,113,.12);
  border-bottom: 1px solid rgba(46,204,113,.22);
}

#vehicleDetailBox .vehPhotoCard.pending{
  border-color: rgba(249,213,21,.44);
}

#vehicleDetailBox .vehPhotoCard.pending .vehPhotoLabel{
  background: rgba(249,213,21,.18);
  border-bottom: 1px solid rgba(249,213,21,.30);
}

#vehicleDetailBox .vehPhotoCard.bad{
  border-color: rgba(255,77,77,.36);
}

#vehicleDetailBox .vehPhotoCard.bad .vehPhotoLabel{
  background: rgba(255,77,77,.12);
  border-bottom: 1px solid rgba(255,77,77,.24);
}

#vehicleDetailBox .vehPhotoImg{
  background: #e5e7eb;
  position: relative;
  aspect-ratio: 4 / 3;
}

#vehicleDetailBox .vehPhotoImg img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#vehicleDetailBox #btnVehSaveColor.vehicleBtn{
  height: 46px;
  border-radius: 12px;
  font-size: 13px;
}

#vehicleDetailBox #vehicleDetailErr.vehErr{
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,77,77,.30);
  background: rgba(255,77,77,.10);
  color: #8a1e1e;
  font-weight: 800;
  font-size: 12px;
  display: none;
}

#vehicleDetailBox #vehicleDetailErr.vehErr:not(:empty){
  display: block;
}

/* Finance panel */
#financePanel .drawerFilterRow{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

#financePanel #financeFilters{
  align-items: stretch;
}

#financePanel .drawerList{
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#financePanel .drawerCard{
  border: 1px solid var(--veh-border);
  background: var(--veh-surface);
  border-radius: 14px;
  padding: 10px;
  box-shadow: var(--veh-shadow);
}

#financePanel .drawerCardTitle{
  font-size: 13px;
  font-weight: 900;
  color: var(--veh-text);
  margin-bottom: 5px;
}

#financePanel .drawerCardMeta{
  font-size: 12px;
  color: var(--veh-muted);
}

#financePanel .drawerCardPills{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

#financePanel .drawerCardPill{
  border: 1px solid var(--veh-border);
  border-radius: 999px;
  background: var(--veh-surface-2);
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--veh-text);
}

#financePanel .drawerEmpty{
  border: 1px dashed var(--veh-border);
  border-radius: 12px;
  padding: 10px;
  color: var(--veh-muted);
  font-size: 12px;
  background: var(--veh-surface-2);
}

#financePanel #financeMsg.smallHint{
  margin-top: 4px;
  margin-bottom: 8px;
}

#financePanel .financeSummaryGrid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#financePanel .financeKpi{
  border: 1px solid var(--veh-border);
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(180deg, #fff, var(--veh-surface-2));
}

#financePanel .financeKpiLabel{
  font-size: 11px;
  font-weight: 800;
  color: var(--veh-muted);
}

#financePanel .financeKpiValue{
  margin-top: 4px;
  font-size: 16px;
  font-weight: 1000;
  color: var(--veh-text);
}

#financePanel .financeSectionTitle{
  margin-top: 12px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 1000;
  color: var(--veh-text);
}

#financePanel .financeMiniCard{
  box-shadow: none;
}

#financePanel .financeTwoCols{
  margin-top: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  font-size: 12px;
  color: var(--veh-text);
}

#financePanel .financeAmtPlus{
  color: #157347;
  font-weight: 900;
}

#financePanel .financeAmtMinus{
  color: #b42318;
  font-weight: 900;
}

#financePanel .financeGraphWrap{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#financePanel .financeGraphRow{
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 8px;
}

#financePanel .financeGraphDate{
  font-size: 12px;
  font-weight: 800;
  color: var(--veh-muted);
}

#financePanel .financeGraphTrack{
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(11,15,25,.09);
}

#financePanel .financeGraphFill{
  height: 100%;
  background: linear-gradient(90deg, #f9d515, #f3c600);
  border-radius: inherit;
}

#financePanel .financeGraphVal{
  font-size: 12px;
  font-weight: 900;
  color: var(--veh-text);
}

#financePanel .financeWithdrawForm{
  border: 1px solid var(--veh-border);
  background: var(--veh-surface);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--veh-shadow);
}

@media (max-width: 540px){
  #financePanel .drawerFilterRow,
  #financePanel .financeSummaryGrid,
  #financePanel .financeTwoCols,
  #vehicleDetailBox .vehDetailGrid,
  #vehicleDetailBox .vehPhotosGrid,
  .vehInspectionActions > div,
  #sideDrawer .vehicleActions{
    grid-template-columns: 1fr;
  }

  #vehicleDetailBox .vehDetailMeta{
    text-align: left;
  }
}
